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

Stepsize not working when min is specified #5644

Closed
kashwath opened this issue Jul 20, 2018 · 5 comments · Fixed by #6966
Closed

Stepsize not working when min is specified #5644

kashwath opened this issue Jul 20, 2018 · 5 comments · Fixed by #6966
Milestone

Comments

@kashwath
Copy link

kashwath commented Jul 20, 2018

Expected Behavior

Stepsize should be considered from the min value.

Steps to Reproduce (for bugs)

This is my fiddle - https://jsfiddle.net/4p93aew7/10/

Context

I have a scenario where I have min, max and stepsize of each chart

Environment

  • Chart.js version: 2.7.2
  • Browser name and version: Chrome, Firefox
@kashwath kashwath reopened this Jul 20, 2018
@etimberg
Copy link
Member

@kashwath the issue is that the range (40-5=35) is not divisible by 8. When this happens, there needs to be 1 uneven step to draw. I don't think we make any guarantees as to which edge the uneven step is on. @simonbrunel @benmccann thoughts?

@benmccann
Copy link
Contributor

I was going to make the autoskipper try to utilize round numbers, which I think would get the effect that's being looked for here. See #4612 for details

However, before working on the autoskipper I wanted to fix the timezone issues so that I can ensure it works for the time chart as well. I'm hoping to get a review on #5522 so that I can continue the work down that path. @simonbrunel I'd appreciate it if you can give that PR a look when you have some time available. Thanks!

@kashwath
Copy link
Author

kashwath commented Jul 23, 2018

@etimberg @benmccann
Another issue with stepSize - see the fiddle. Working on v2.5 and broken on v2.7.2
Step size should be 1.4

https://jsfiddle.net/4p93aew7/37/ ( working - v2.5.0)
https://jsfiddle.net/4p93aew7/38/ (broken - v2.7.2)

@nagix
Copy link
Contributor

nagix commented Aug 22, 2018

@kashwath The last problem is resolved by #4841. Set ticks.precision to 1.

@nagix
Copy link
Contributor

nagix commented Oct 24, 2018

The last problem was not fixed by #4841 because ticks.precision is effective only if stepSize is not specified. I created a new PR #5786.

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.

4 participants