-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Bugged rounding algorithm when setting Extremes for y axis #17100
Comments
In steps how this mechanism works for alleged bugged demo:
This mechanism is sensitive to the data and axis options and results might differ in case of a small change. |
Thanks for debugging @karolkolodziej! Yes it is true that this approach is sensitive to small variations in the data extremes. It seems like this is an unfortunate edge case where neither step 2 nor step 5 hit the mark, so we eventually end up with too much padding. The only thing I can think of if we were able to modify those steps to hit the desired |
I'm trying a more granular increment instead of the *2 in step 4. Pushing a POC soon, let's see what visual differences the CI finds. |
@ThomasK0lasa your chart with the new algorithm: https://jsfiddle.net/BlackLabel/vxn7j9L4/ |
@karolkolodziej thank you. Looks great. When this fix will be available in production? More or less. |
The next release is planned for the following month. |
Expected behaviour
Better rounding: 106 rounded to 120;
Actual behaviour
Wrong rounding 106 rounded to 200. This happens for ONLY specific min and max. Take a look at examples below.
Live demo with steps to reproduce
Proper rounding: 99 rounded to 100 > https://jsfiddle.net/y9cz1Lu0/4/
Proper rounding: 112 rounded to 120 > https://jsfiddle.net/y9cz1Lu0/5/
WRONG rounding: 106 rounded to 200 (BUGGED) > https://jsfiddle.net/2mn8yd0k/2/
As You can see the rounding for specific min max is wrongly calculated (106 rounded to 200?). Please don't tell me that I can do
endOnTick: false
or change thetickAmount
as this is not solving the problem, but merely omitting it.Product version
Highcharts JS v10.0.0 (2022-03-07)
Affected browser(s)
Chrome 99.0.4844.51
The text was updated successfully, but these errors were encountered: