Skip to content
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

Bad hover tooltip when using dates with PlotlyJS #1385

Closed
cstjean opened this issue Feb 7, 2018 · 7 comments
Closed

Bad hover tooltip when using dates with PlotlyJS #1385

cstjean opened this issue Feb 7, 2018 · 7 comments

Comments

@cstjean
Copy link

cstjean commented Feb 7, 2018

The x-axis tooltip in this example is a number instead of a date.

screenshot from 2018-02-07 08-47-39

Interestingly, the tooltip works correctly when hovering over datapoints that are exactly over tick marks. The equivalent code works fine when using PlotlyJS directly. I assume that it's the same underlying issue as #1382, and probably #726

@pearlzli
Copy link
Contributor

pearlzli commented May 9, 2018

I'd also be interested in a fix to this. Does anyone have any ideas for how to get around this? I'd be happy to take a look at it, but I don't quite know where to begin.

@mkborregaard
Copy link
Member

mkborregaard commented May 9, 2018

Maybe the solution is when the DateTimeFormatter runs (to create the date breaks on the x axis) to check if hover is set explicitly, and if it isn't set it explicitly with formatted dates.

@pearlzli
Copy link
Contributor

pearlzli commented May 9, 2018

I'll try that, thanks!

As an aside, I noticed that datetimeformatter, dateformatter, and timeformatter are not listed in the attributes table. I can add that via pull request if you want, but which file should I edit to do so?

@cstjean
Copy link
Author

cstjean commented May 9, 2018

@pearlzli If you use ticks=:native, then the tooltip is correct.

@pearlzli
Copy link
Contributor

pearlzli commented May 9, 2018

@cstjean Yes, I just noticed this! However, I also want to do two more things: set my own tick-marks and show my dates as quarters (e.g. "2010-Q1" instead of "Mar 2010"). I'm trying to implement that now using the formatter attribute...

@mkborregaard Upon further investigation, I think the hover attribute changes the string that's displayed next to the actual data value (currently "15" in @cstjean's example), not the string displayed on the x-axis.

@mkborregaard
Copy link
Member

That's right, sorry. I

@johnrichardrinehart
Copy link
Contributor

@pearlzli I think this issue should be closed in light of ticks=:native solving this particular problem.

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

5 participants