plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Dynamic hoverinfo placement based on axis location

Open rpaskowitz opened this issue 9 years ago • 2 comments

From discussion on #1461 , the position of the hoverinfo drawn on points should be based not only on how close the point is to the edge of the chart, but also based on which axis the point refers to. Today in instances where the datapoint is plotted on a right axis the hoverinfo can be drawn over the axis making it harder to understand the point's relative position. For example, on mocks/multiple_axes_multiple.json: image

From @alexcjohnson:

if we did this based on the pixel position of the axis relative to the hovered-on point, rather than on the side, then if you put a free axis over the middle of the plot, the labels would flip as you cross the axis, which seems like it would be a cool & useful effect - and you'd automatically get it right for free axes off the edge

rpaskowitz avatar Mar 13 '17 05:03 rpaskowitz

Thanks for pointing this out @rpaskowitz !

Similar to https://github.com/plotly/plotly.js/issues/1468#issuecomment-286126183, I think this proposed could be turned on/off by a boolean in the cartesian axis attributes.

etpinard avatar Mar 13 '17 14:03 etpinard

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

gvwilson avatar Jun 10 '24 14:06 gvwilson