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 x axis starts with one day offset #4376

Open
Aigarsss opened this issue Apr 2, 2024 · 2 comments
Open

Datetime x axis starts with one day offset #4376

Aigarsss opened this issue Apr 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Aigarsss
Copy link

Aigarsss commented Apr 2, 2024

Hi all.

It looks to me, that the dates are off/offset for the x axis (even in the examples, as well as in my own code) if xaxis has datetime values. It is visible even in the example on the homepage - https://apexcharts.com/javascript-chart-demos/mixed-charts/line-column/

The data should start with 1st of Jan 2001, but it actually starts with 31st of Dec. Furthermore, the x axis label also doesn't show '01 jan, but Jan '01, which also doesn't look correct to me. Am I missing something here, because this looks like a bug to me.

Steps to Reproduce

  1. Create a mixed Line Column in apexchart
  2. Add date labels OR xaxis: {categories}, produces same issue for both
  3. Hover the first value, it will show the date offset by -1 on the label, and x axis label is also not correct

Expected Behavior

Show 01 jan on x axis and when hovering on first bar, show legend with 01 jan, not 31 dec

Actual Behavior

Shows Jan '01 on x axis and when hovering on first bar, shows legend with 31 dec. It also ends on the wrong date, since data is offset

Screenshots

image

Reproduction Link

codepen

@Aigarsss Aigarsss added the bug Something isn't working label Apr 2, 2024
@Aigarsss
Copy link
Author

Aigarsss commented Apr 3, 2024

If I remove the xaxis type:
xaxis: {
// type: 'datetime',
}

Then it seems to be working correctly. Is that expected?

@alejandraarri
Copy link

It does not work correctly for me. 😞 Any plans to fix this issue?

This is related to this other ticket: #3236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants