8000 Improve calculation for number of ticks that can fit by benmccann · Pull Request #6927 · chartjs/Chart.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve calculation for number of ticks that can fit #6927

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

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

benmccann
Copy link
Contributor

master: https://codepen.io/kurkle/pen/GRgyGRx
This PR: https://codepen.io/benmccann/pen/QWwaoGK

Adding 1 to ticksLimit in _autoSkip is wrong. The reason it was done was that the ticks may extend past the scale edge. However, what was not taken into account was that the ticks may not align perfectly with the scale edges. Look at "Sep 2014" on https://codepen.io/kurkle/pen/GRgyGRx. It's not right at the chart edge. So we should subtract one tick to make up for this and these effects cancel each other out.

Copy link
Member
@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

There is another bug show in that pen, hover the 'series' mode chart from the right edge, there will be some errors on console (element is undefined)

@etimberg etimberg merged commit 3b55de7 into chartjs:master Jan 7, 2020
@kurkle kurkle mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0