-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Inconsistent datetime hoverinfo with Scattergl and datetime axis #3181
Comments
This happens when the two traces have nearly but not quite identical x values. They’re close enough that it makes sense to compare them, but we need to show both x values because they are, in fact, different, and we want to make the viewer aware of this. You’re right though that it looks odd, I’m open to suggestions to improve it. |
Although obviously related, to me that doesn't seem to be exactly what's happening here:
As an aside - is there any way to control the threshold of how close two x values can be before they're identified as nearly identical? Because I have some cases where I'd want to set this to 0 (i.e. only ever show hover labels for identical discrete x values) or a larger number (to allow for more tolerance with slightly misaligned continuous time series, for example) or even just perform linear interpolation if possible. |
When you're in "compare" mode we try to identify a "common label" for x (or for y, in case of eg horizontal bars), and this label is drawn on the axis - the black label in your gif. Then any individual label that has Incidentally, #3126 will provide one way around this, since you'll be explicitly specifying the format for each label. I suspect after that PR, if all traces have a
The logic is a bit convoluted... in some cases
proposed in #1960 |
Ah I see, thanks for the explanation! So in the end, everything here is working as expected, even though it feels slightly odd at first. Can be confirmed by setting So if I understood correctly - even if there were some threshold we could use to control how different two x values have to be before they're considered close enough to draw both hover labels, in this example the mouse would always be over a marker from both lines (because However, in other cases, Back to the topic at hand - I don't have any ideas for improving this behaviour. It seems logical |
OK great - I'll close it as we don't have a clear action item, but you're right that it has some quirks. If any future readers have a concrete suggestion for improving this feel free to reopen! |
(although I forgot to reiterate that maybe #2334 (comment) should be reopened? or should I create another issue?) |
Following on from the suspected regression of #2334, I also noticed a slightly different issue.
In this plot, both
Scattergl
s are plotted withhoverinfo: 'x+y'
. However, trace 1 only has y in the hover label, and trace 2 has y but sometimes also x (but only when hover labels for both trace 1 and 2 are plotted at the same time, and even then not consistently).https://codepen.io/anon/pen/xyNLKL
The text was updated successfully, but these errors were encountered: