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

Missing ticks on X axis and wrong labels on X axis #4940

Closed
MattChique opened this issue Feb 11, 2025 · 1 comment
Closed

Missing ticks on X axis and wrong labels on X axis #4940

MattChique opened this issue Feb 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@MattChique
Copy link

MattChique commented Feb 11, 2025

Description

We just wanted to update from 3.51 to current version. We noticed that x axis scaling and ticks are not properly calculated.
It seems that in 3.52 it stopped working.

Steps to Reproduce

It seems to be also impacted by xaxis:min and xaxis:max or better, if on x are mainly numbers with the same number before decimal seperator.

Check https://codepen.io/MattChique/pen/emYYzxg

X axis tick amount is 5. Zooming in or out sometimes shows some ticks.

Expected Behavior

  • The last label of the x axis should show the last value.
    • Last x tick label: 278.00
  • If option say, there should be 5 ticks, then 5 ticks should be displayed.

Actual Behavior

  • The last label of the x axis does not match with the charts last value. The last x axis tick is not the last x value of the chart.
    • Last x tick label: 275.50
  • Ticks are missing, but seem to randomly come pack on zoom.

Screenshots

unfortunately i was not able to upload any images without error

Reproduction Link

https://codepen.io/MattChique/pen/emYYzxg

@MattChique MattChique added the bug Something isn't working label Feb 11, 2025
@MattChique
Copy link
Author

Check https://github.com/apexcharts/apexcharts.js/blob/beb688bac6993ee9301f6bae8a7d957ec755c9f5/src/modules/Scales.js#L592C8-L592C8

If x axis max is 276 and x axis min is 274.5, diff is 1,5, which results in 1 tick.

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