fix: fix rounding error in y-axis when max less than 1 #352
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation About What Code Achieves:
Fixes this rounding issue:
![image](https://user-images.githubusercontent.com/875591/127074361-31ba17c7-409e-45f2-926b-8cab8903d4d3.png)
So that ticks are calculated without rounding errors.
You can run getChartIntervals(0.8) to replicate this behavior:
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)