-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
how to enable auto-formatting for time axis on zoom events with custom date-time format? #1513
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
Comments
Can you share a reproducible example using codePen / jsFiddle / jsBin? Thank you. |
@etpinard
Actually, I want to hide the date on the first tick while keeping the default formatting functionality on zoom-in/zoom-out, which enables expansion/collapse to seconds/minutes levels. |
If I understand your goal correctly, sounds like you don't want to ever see the date, but otherwise you like the automatic time formatting we do? This seems like a somewhat generalizable situation: you have some data where only the time is important - maybe a result of merging together many days worth of data, to see some effect that depends only on time of day. You could also imagine a similar situation where year is arbitrary. Or any other repeated interval such as weeks, months, hours... but those might be harder to handle in a consistent, meaningful way than time within a day - even year is tricky when you consider leap years. Seems like a reasonable feature to consider, either in a weak form (just dropping the arbitrary portions of the time from display, that would be fairly easy) or a stronger form (actually wrapping data to that period, would be a bigger project). |
I think #1965 essentially solves this ticket. @juni-green can you confirm? |
Closing due to lack of activity. |
Hi,
Is there any way to keep the auto-formatting enabled for time axis in plotly.js graph even after applying customized formatting using "tickformat"?
Actually, I have customized the time format using:
tickformat: "%H:%M"
such that only Hour:Minutes appear on the time axis. But by doing so, I lost the default formatting functionality that works on zoom-in/zoom-out events. Now if I zoom-in, the tick format doesn't expand to seconds or milliseconds. Is it possible to make it work like default auto-formatting functionality on zooming-in/zooming-out with the above mentioned customization?
Any help will be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: