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

Odd number vs even number with different behavior #11860

Open
mintyPT opened this issue Aug 13, 2024 · 3 comments
Open

Odd number vs even number with different behavior #11860

mintyPT opened this issue Aug 13, 2024 · 3 comments

Comments

@mintyPT
Copy link

mintyPT commented Aug 13, 2024

Expected behavior

For a simple bar graph, when the max number is odd, the bars are not filling to the top of the chart. For even numbers, it's working as expected.

Current behavior

For a simple bar graph, for any max number, the bars should fill to the top of the chart.

Reproducible sample

https://codepen.io/mintyPT/pen/poXdReE

chart.js version

v4.4.1

Browser name and version

Latest chrome


CleanShot 2024-08-13 at 19 07 49

@mintyPT
Copy link
Author

mintyPT commented Aug 13, 2024

Turns out it might not be odd/even related because it breaks with 202. Interestingly, a while ago it was breaking at 5 and now it works.

@LeeLenaleee
Copy link
Collaborator

This is by design to create nice looking ticks. If you want to bar to always be filled exactly to the top you can provide your own max option in the scale config.

@mintyPT
Copy link
Author

mintyPT commented Aug 16, 2024

Thanks for the information. Out of curiosity, what's the logic here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants