-
Notifications
You must be signed in to change notification settings - Fork 524
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
How can I localize time scale labels? #3034
Comments
Localization guide can be referenced here https://commerce.nearform.com/open-source/victory/docs/guides/localization |
Tthis doesn't solve my problem, by providing a tick formatter for the axis, the dates will always have the same format, and the functionality I want to maintain is precisely the change of the date format depending on how zoomed in the graph is. In the example of Pan and Zoom combined with Brushing in the documentation, without zooming, the labels are just the years, but as you zoom, the labels become more specific, showing the months, the days and depending on the data even the hours, and I can't see how to replicate this using just the tick format. |
You can achieve dynamic date formatting based on zoom levels by using a function like this:
and then using it with axis like
This function updates the date format dynamically as the zoom level changes, mimicking the behaviour in the Pan and Zoom example from the documentation. Here is a demo with working example: https://codesandbox.io/p/sandbox/victory-axis-label-zoom-ytfp46 |
Is there an existing issue for this?
Code of Conduct
Question
The text was updated successfully, but these errors were encountered: