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

[BUG] Linear Axis stepSize leads to unexpected behaviour when decimal and greater than 1 #5579

Closed
V-Mario opened this issue Jun 20, 2018 · 4 comments
Milestone

Comments

@V-Mario
Copy link

V-Mario commented Jun 20, 2018

Current Behavior

Linear Axis stepSize leads to unexpected behaviour when its value is decimal and greater than 1
Here's an example: https://codepen.io/V-mario/pen/qKoWRE

Expected Behavior

Grid lines should be equally spaced thus values shown under x axes should be [0, 1.3, 2.6, 3.9, 5.2, 6.5, 7.8, 9.1, 10.4, 11.7, 13] as max is 13, min 0 and stepSize 1.3

Here's a working example having stepSize 0.9 instead: https://codepen.io/V-mario/pen/LrdPyp

Environment

  • Chart.js version: 2.72
  • Browser name and version: Chrome 67.0.3396.87
@V-Mario V-Mario changed the title [BUG] Linear Axis stepSize is ignored when value is decimal and greater than 1 [BUG] Linear Axis stepSize leads to unexpected behaviour when its value is decimal and greater than 1 Jun 20, 2018
@V-Mario V-Mario changed the title [BUG] Linear Axis stepSize leads to unexpected behaviour when its value is decimal and greater than 1 [BUG] Linear Axis stepSize leads to unexpected behaviour when decimal and greater than 1 Jun 20, 2018
@nagix
Copy link
Contributor

nagix commented Aug 22, 2018

This is resolved by #4841. Set ticks.precision to 1.

@V-Mario
Copy link
Author

V-Mario commented Sep 18, 2018

Pen modified as suggested but the result is the same

@nagix
Copy link
Contributor

nagix commented Sep 18, 2018

#4841 is not included in 2.7.2. Wait for the next release.

@etimberg etimberg added this to the Version 2.7.3 milestone Sep 23, 2018
@nagix
Copy link
Contributor

nagix commented Oct 24, 2018

This was not fixed in 2.7.3 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

No branches or pull requests

5 participants