-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
X-axis times ticks are not display major hour like 11:00 12:00 #4537
Comments
Sure, but as it stands your data in iso format will not get parsed correctly. In order for recharts to interpret time correctly it needs to be in milliseconds. This way it can plot time along a numerical axis and you can use the formatter function to display as you wish. hopefully we can support parsing iso timestamps in the future |
@ckifer Updated times to milliseconds now. But I can not figure out how to display major hour ticks like that 11:00, 12:00, though there is no data with that time. https://codesandbox.io/p/sandbox/recharts-issue-template-forked-dpq4rd |
Yeah, this needs to be easier. Essentially what you would have to do is precalculate what those ticks would be in numeric value and then add them to the XAxis
Not sure about adding a differentiation when the day changes, but there should be a way to figure that out |
Edited the sandbox with detecting when the day changes, ended up being very simple. Let me know if this solves your usecase! |
Going to close this as answered, feel free to comment back if there are issues |
Thanks @ckifer. It works. |
@ckifer New Day ticks not rendering correctly. Like Here the new day is |
It's only going to run the formatter function on the ticks that are actually shown. So unless you angle the ticks to get more to show, always the first one that is showing in that day will have the extra label |
I want to display x-axis ticks hourly value like that
11:00
or12:00
if there any new day come then display
14 May 2024 11:00
Is that possible with recharts?
Here is my code snippet.
https://codesandbox.io/p/sandbox/recharts-issue-template-forked-dpq4rd
The text was updated successfully, but these errors were encountered: