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

Fix tick spacing calculation #6761

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Fix tick spacing calculation #6761

merged 1 commit into from
Nov 18, 2019

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Nov 18, 2019

Fixes: #6759

@benmccann do you recall why that - 1 is there?

@benmccann
Copy link
Contributor

Yeah, here's an old comment that maybe should have been left:

// Total space needed to display all ticks. First and last ticks are

Basically we're counting the spaces between ticks and figuring out how to divide that

@kurkle
Copy link
Member Author

kurkle commented Nov 18, 2019

This is actually the index spacing to ticks array to make enough fit. So not quite same thing anymore.

@benmccann
Copy link
Contributor

I see we have a + 1 already that probably accounts for this with the ticks at the end hanging off the edge:

var ticksLimit = tickOpts.maxTicksLimit || axisLength / me._tickSize() + 1;

So yeah, it might be the case that we're doing a +/- 1 adjustment an extra time

@etimberg etimberg added this to the Version 3.0 milestone Nov 18, 2019
@etimberg etimberg merged commit 542f598 into chartjs:master Nov 18, 2019
@kurkle kurkle deleted the spacing-fix branch December 7, 2019 05:36
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.

Custom labels overlapping with maxRotation 0
3 participants