Lark
Posts: 21
Joined: Sun Jan 02, 2022 2:13 pm

Axis padding despite setting both max and padding

Hello all!
In the sandbox below both the axes have a padding.
I saw the docs for maxPadding, softThreshold, and some other topics on the subject, and have thus set maxPadding to 0 on both axes, set softThreshold to false for all series, and specified min and max for both axes, yet the padding persists.

The left axis should be 0-1000 but is appears as 0-1200 (no values are above 1000).
The right axis should be 0-1 but appears as -0.2-1 (all values are 0-1).

Why is that?

CodeSandbox
Lark
Posts: 21
Joined: Sun Jan 02, 2022 2:13 pm

Re: Axis padding despite setting both max and padding

So this is really awkward but after a couple hours of fiddling I hard refreshed the sandbox and everything showed up as expected... Seems it was just an issue in the sandbox, and you can't actually see it in the example becuase it doesn't exist. You can delete this thread if you like it's pretty pointless. Sorry for wasting your time!
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Axis padding despite setting both max and padding

Hi Lark,

Are you sure it is working fine now? For me it still shows values that are out of min and max range.
Demo: https://codesandbox.io/s/sleepy-sun-37tgz

This is caused by yAxis.alignTicks option, which is enabled by default and make axes extend until they match their ticks. Setting that option to false solves the problem.
Demo: https://codesandbox.io/s/tender-gould-h5vfc
API reference: https://api.highcharts.com/highcharts/yAxis.alignTicks

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”