Skip to content

Custom hover label issue [scatter3d] #2884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
YaroslavTrubanov opened this issue Aug 8, 2018 · 9 comments
Closed

Custom hover label issue [scatter3d] #2884

YaroslavTrubanov opened this issue Aug 8, 2018 · 9 comments

Comments

@YaroslavTrubanov
Copy link

If i set custom hover text on point then PointName is duplicated from this text and seems incorrect. I want be able to set both custom name and custom hover.

For example:
image
I want to see only "FirstPrice" as name of point

Code of trace with incorrect display:

                var overbookingShowsPointsX = overbookingShowsPoints.map(point => point.x);
                var overbookingShowsPointsY = overbookingShowsPoints.map(point => point.y);
                var overbookingShowsPointsZ = overbookingShowsPoints.map(point => point.z);
                var overbookingShowsPointsText = overbookingShowsPoints.map(point =>
                    "Days = " + point.x + "<br>" +
                    "Cap = " + point.y + "<br>" +
                    data.currency + " = " + point.z + "<br>" + 
                    point.text);
                var overbookingShowsPointsTrace = {
                    name: "Overbooking & No shows",
                    type: 'scatter3d',
                    mode: 'markers+text',
                    x: overbookingShowsPointsX,
                    y: overbookingShowsPointsY,
                    z: overbookingShowsPointsZ,
                    text: overbookingShowsPointsText,
                    textposition: 'top',
                    hoverinfo: "text",
                    marker: {
                        size: markerRadius,
                        color: 'rgb(11, 31, 255)',
                    },
                    namelength: 0
                };
@etpinard
Copy link
Contributor

etpinard commented Aug 8, 2018

What if you set hoverinfo: 'text+name'?

@YaroslavTrubanov
Copy link
Author

Same issue
image

@etpinard
Copy link
Contributor

Hmm. I don't think I understand your problem. Are you referring to the <br> characters? If so, this issue is likely a duplicate of #2551

@YaroslavTrubanov
Copy link
Author

I mean that i should see as name of point - Max overbooking (0%). Instead of this i see text which used in hover div

@etpinard
Copy link
Contributor

That's because, you have mode: 'markers+text'. I think mode: 'markers' is what you want.

@YaroslavTrubanov
Copy link
Author

If i use mode: 'markers' then i dont see name at all
image

@etpinard
Copy link
Contributor

what with mode: 'markers' you set hoverinfo: 'text+name'?

If that doesn't work, please use codepen or jsfiddle to sent us a fully reproducible example. I don't think this is a bug, so you might want to look https://community.plot.ly/c/plotly-js for help. Thank you.

@etpinard
Copy link
Contributor

Closing due to lack of activity.

@YaroslavTrubanov
Copy link
Author

YaroslavTrubanov commented Sep 25, 2018

Hello, sorry for lack of activity. I was on vacation.
Here is plotly example: https://plot.ly/~marcus1812/1/
My goal is to see only PointName as name of points of trace: "Overbooking & no shows".

what with mode: 'markers' you set hoverinfo: 'text+name'?

Its not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants