apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.06k stars 1.28k forks source link

Heatmap x-axis datetime ticks do not line up with data #4036

Open Lahe opened 9 months ago

Lahe commented 9 months ago

Description

Heatmap x-axis ticks do not line up with the rectangles being drawn when xaxis: { type: 'datetime' } is set.

Steps to Reproduce

  1. Create a heatmap with xaxis: { type: 'datetime' }.
  2. (optional) Create a range annotation on the x-axis to have a better visual of the problem.
  3. See how the heatmap rectangles are misaligned from the ticks.

Expected Behavior

Heatmap rectangle widths should line up with the x-axis tick gaps.

Actual Behavior

Heatmap rectangles do not line up with the x-axis ticks.

Screenshots

image

Reproduction Link

https://codesandbox.io/s/crazy-chaum-2wjgzj?file=/src/App.js

First chart shows the problem described above.

Second chart shows a line chart and how the data points line up with the x-axis ticks as they should.

Last chart is an attempt to use xaxis: { type: 'category', tickPlacement: 'on' } as a workaround, but the tick placement does not work and the ticks are still drawn in between the data points.

Khazl commented 3 weeks ago

Have the same issue. Seems like it's still not fixed. Anyone a idea how to work-around this? Screenshot_428