-
-
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
Wrong year assigned to a ticklabel in plotly.js #6457
Comments
It's an issue in d3-time-format |
Sometimes the last week of the year is week 1, like in 2019. But not in 2020 |
OK this doesn't seem to be a real issue. The first week of 2021 is called week 53: http://www.whatweekisit.org/calendar-2021.html Because tickmode="auto", the first tick is drawn probably at 2021-01-01, which is week 53 of 2021. It should be possible to get exactly the ticks you want by using tickvals. |
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
The following image contains a part of a scatter plot generated with plotly.js:
The red arrow shows the wrong value in ticklabel. It should be 53 2020.
If a zoom is made, then the right ticklabels are obtained:
This problem appears just when the ticklabel is generated when date is December 31st of any year.
One attention calling point is that the value of showed data in the first image when the mouse is over the point (following the green arrow), is the right one: 53, 2020!
The code for this issue can be found at: codepen
After a little research, a possible cause of issue could be related to:
Plotly uses Date.getUTCFullyear to calculate ticklabels,
For a date given on December 31st, the result may be different according to getUTCFullYear in MDN.
??
Or, is there any other cause producing this issue?
Please, can anyone help to solve it? Thanks.
The text was updated successfully, but these errors were encountered: