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

Y-axis tick values are not always nicely generated #298

Open
lukwallace opened this issue Sep 10, 2019 · 1 comment
Open

Y-axis tick values are not always nicely generated #298

lukwallace opened this issue Sep 10, 2019 · 1 comment

Comments

@lukwallace
Copy link
Contributor

lukwallace commented Sep 10, 2019

yAxis tick value generation uses a niceTicks function that seems to generate some not so nice ticks on certain datasets:

_.nw.niceTicks(-16575919.58, 0, undefined)
//  creates [-16575919.6, -12575919.6, -8575919.6, -4575919.6, -575919.6, 3424080.4]

Found while testing with data set: [-16575919.58, 0, 0, 0]

@lukwallace lukwallace changed the title niceTicks does not generate nice ticks niceTicks does not always generate nice ticks Sep 10, 2019
@lukwallace lukwallace changed the title niceTicks does not always generate nice ticks Y-axis tick values are not always nicely generated Sep 10, 2019
@safetybelt
Copy link

This is true of small datasets as well:

 _.nw.niceTicks(0, 0.022, undefined) 
// creates [0, 0, 0, 0, 0]

We also have a report of issues with large datasets, but I'm unable to reproduce.
This is what the user reported:
image

After investigation, the labels were essentially floating point bugs where the label would want to be 1000000.0000000000000002 and would get changed to 1.0000000000000002M.

We should investigate if it's possible using niceTicks or if they were overwriting the formatter (or similar).

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

No branches or pull requests

2 participants