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

Category scale fails to compute proper bar width when zoomed enough #8994

Closed
kurkle opened this issue Apr 28, 2021 · 0 comments · Fixed by #8995
Closed

Category scale fails to compute proper bar width when zoomed enough #8994

kurkle opened this issue Apr 28, 2021 · 0 comments · Fixed by #8995

Comments

@kurkle
Copy link
Member

kurkle commented Apr 28, 2021

Expected Behavior

Bars should be sized properly

Current Behavior

Bars shrink after enough zooming. This happens because all of the data values are considered, and getPixelForValue is executed for each index. The method is limited to +/-32k pixels, which then results to too small distance between bars around those limits.

ok
image

not ok (zoomed one step more)
image

Possible Solution

Stop considering bars outside visible area, should perform better too.

Steps to Reproduce

https://codepen.io/kurkle/pen/rNjbKJg

Context

chartjs-plugin-zoom

Environment

  • Chart.js version: 3.2.0
  • Browser name and version: Chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants