Skip to content

Bugged rounding algorithm when setting Extremes for y axis #17100

@ThomasK0lasa

Description

@ThomasK0lasa

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 the tickAmount 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions