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 unit determination when autoSkip is enabled #6583

Merged
merged 1 commit into from Oct 24, 2019

Conversation

benmccann
Copy link
Contributor

@benmccann benmccann commented Oct 21, 2019

determineUnitForFormatting doesn't work well when autoSkip is enabled because it relies on the number of ticks, which changes when the autoSkip is applied. Now that autoSkip is aware of major ticks this is a more noticeable issue

I removed a division by 2. Two test failed without this change, but changing it also meant I had to change a couple other tests. It's somewhat subjective as to what produces better results. However, I felt this produced better results for the related tests. I could not find a compelling reason as to why this division was introduced in the first place and it seemed somewhat arbitrary to do it. The number of ticks in the test is larger because it switched from days to hours (so x 24) and it's before autoSkip is applied. After autoSkip the number of ticks doesn't change all that much

Before

Screenshot from 2019-10-20 19-45-31

After

Screenshot from 2019-10-20 19-45-36

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.

I did not do a through testing, but I'm confident this does not make it worse :)

@etimberg etimberg merged commit f606c23 into chartjs:master Oct 24, 2019
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants