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

Datetime in xaxis has an offset of one day #209

Closed
lukasleitsch opened this issue Nov 21, 2018 · 3 comments
Closed

Datetime in xaxis has an offset of one day #209

lukasleitsch opened this issue Nov 21, 2018 · 3 comments

Comments

@lukasleitsch
Copy link

Codepen

In the documentation I found this example: https://codepen.io/apexcharts/pen/eVvjZx

Explanation

The dates on the x axis will not be shown exactly in the graph. E.g. the data array contains a couple with the date 02-11-2017. If you hover over this point in the graph the tooltip show the 10 Feb. On day before the defined. I expect that the tooltip shows the same date that was defined in the data array.

The following screenshot shows the offset between the defined date and the date in the tooltip:

bildschirmfoto 2018-11-21 um 11 16 30

@junedchhipa
Copy link
Contributor

junedchhipa commented Nov 21, 2018

Updated the example - https://codepen.io/apexcharts/pen/eVvjZx
You have to make sure you provide GMT dates when injecting data into the series.
Otherwise, you may use a datetime library like date-fns to handle datetime with local offsets.

If you see this timestamp example, the timestamp values are in the local datetime, so that's why it displays slight difference in actual dates when hovering.

@lukasleitsch
Copy link
Author

I see. Adding GMT in the x value works for me. Thanks for you very fast reply.

@danielthedifficult
Copy link

Just wanted to say that I ran into this problem and am very grateful to have found this post...

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

3 participants