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: fix rounding error in y-axis when max less than 1 #352

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

schnerd
Copy link
Contributor

@schnerd schnerd commented Jul 27, 2021

Explanation About What Code Achieves:

Fixes this rounding issue:
image

So that ticks are calculated without rounding errors.

You can run getChartIntervals(0.8) to replicate this behavior:

getChartIntervals(0.8) === [ 0, 0.2, 0.4, 0.6000000000000001, 0.8 ]

I'm on version 1.6.1. Couldn't test 1.6.2 because it caused a separate bug for me and also the css file isn't present in dist/:
https://unpkg.com/browse/frappe-charts@1.6.2/dist/

Screenshots/GIFs:

See above

Steps To Test:

Create a chart where the maximum value is 0.8.

I tried to write some test cases for this but the project doesn't have a test command (even thought it has some test files)

@scmmishra scmmishra merged commit 10de973 into frappe:master Oct 4, 2021
@schnerd
Copy link
Contributor Author

schnerd commented Dec 10, 2021

@scmmishra Can you do a build+release with this change?

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

2 participants