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

Timeline bars sometimes misaligned, also alignment changes when using zoom function #4813

Open
Vingro opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Vingro
Copy link

Vingro commented Nov 15, 2024

Description

The bars in a timeline chart are sometimes not aligned correctly to the grid and the axis. I thought it might have something to do with time zone vs. UTC, but zooming in and out seems to randomly change the alignment.

Steps to Reproduce

  1. Create a basic timeline chart (for example just copy the example on https://apexcharts.com/javascript-chart-demos/timeline-charts/basic/). Add dates without a time, just like in the example.
  2. Add grid lines to increase visibility of the issue (leaving out the grid lines still show the misalignment against the date axis).
  3. Zoom in and out around the position where a bar starts and check the alignment against grid lines and/or date axis.

Expected Behavior

Perfectly aligned bars, starting directly at the same position where the grid line is, independent of zoom level.

Actual Behavior

Random misalignments. Sometimes the bar starts on the left side of the grid line, sometimes on the right, depending on the zoom level. By default the alignment is already a bit off.

Screenshots

By default already a little bit off:
image

After zooming in by dragging a range, the bar starts on the left of the grid line:
image

After zooming in again, the bar suddenly starts on the right of the grid line:
image

Reproduction Link

https://codepen.io/vingro/pen/LYwaowe
(removed the css to show the issue on full width.

@Vingro Vingro added the bug Something isn't working label Nov 15, 2024
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

1 participant