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

Strange axis labels when fixedStepSize is not a factor of min and max #3409

Closed
fewstera opened this issue Oct 3, 2016 · 1 comment · Fixed by #3415
Closed

Strange axis labels when fixedStepSize is not a factor of min and max #3409

fewstera opened this issue Oct 3, 2016 · 1 comment · Fixed by #3415

Comments

@fewstera
Copy link
Contributor

fewstera commented Oct 3, 2016

I'm trying to use the tickOptions in order to manually set the labels for my yAxis. If I try to use a fixedStepSize that is not a factor of min and max then you end up with strange looking labels.

This codepen explains it best http://codepen.io/anon/pen/JRORQy

I'd expect the labels to be [1, 3, 7, 9, 11, 13, 15, 17, 19, 21] but instead they're [1, 2, 4, 6, 8 ,10, 12, 14, 16, 20, 21]

@etimberg
Copy link
Member

etimberg commented Oct 3, 2016

The tick marks are generated at https://github.com/chartjs/Chart.js/blob/master/src/core/core.ticks.js#L52-L84

It probably needs a special case for the options including min, max and increment. I'm happy to look at a PR for it

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