Reputation: 12999
According to the docs, y axis padding is as follows:
Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the lowest data value to appear on the edge of the plot area. Defaults to 0.05.
But consider this jsfiddle, at the two places I've marked with a comment.
What I'd expect is that increasing the minPadding
from 1.0 to 10.0 would open up a gap between the line and the bottom of the chart (so that the y axis effectively then starts at a negative value)... but it doesn't have any effect at all.
It seems that there is a block on this padding value making the axis go negative (in order to open up the desired padding). But the docs say that it should make the axis longer, without any reference to this being dependent on the data being displayed, and where that data is relative to zero.
Furthermore, I'd not expect just changing one of the data values from slightly positive to slightly negative would have such a whopping effect.
I thought I understood highcharts axis padding, but clearly I do not!
Upvotes: 0
Views: 173
Reputation: 37578
You should set the softThreshold parameter as a false.
series: [{
softThreshold: false,
data: [29.9, 1.5, 6.4, 29.2, 44.0, 76.0, 35.6, 48.5, 16.4, 94.1, 5.6, 0.4]
}]
Upvotes: 1