根据文档 ,y轴填充如下:
相对于轴的长度填充最小值。 填充0.05将使100px轴长5px。 当您不希望最低数据值出现在绘图区域的边缘时,这非常有用。 默认为0.05。
但是考虑一下这个jsfiddle ,在我标记过评论的两个地方。
我所期望的是将minPadding从1.0增加到10.0会打开图表线和底部之间的间隙(这样y轴就会有效地从负值开始)......但它不会有任何影响。
看起来这个填充值有一个阻塞使轴变为负(为了打开所需的填充)。 但文档说它应该使轴更长,没有任何参考依赖于显示的数据,以及该数据相对于零。
此外,我不认为只是将其中一个数据值从略微正面变为略微负面就会产生如此巨大的影响。
我以为我理解了highcharts轴填充,但显然我没有!
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!
最满意答案
您应该将softThreshold参数设置为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] }]http://jsfiddle.net/wzkhuo9t
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] }]http://jsfiddle.net/wzkhuo9t
Highcharts:努力理解轴填充(Highcharts: struggling to understand axis padding)根据文档 ,y轴填充如下:
相对于轴的长度填充最小值。 填充0.05将使100px轴长5px。 当您不希望最低数据值出现在绘图区域的边缘时,这非常有用。 默认为0.05。
但是考虑一下这个jsfiddle ,在我标记过评论的两个地方。
我所期望的是将minPadding从1.0增加到10.0会打开图表线和底部之间的间隙(这样y轴就会有效地从负值开始)......但它不会有任何影响。
看起来这个填充值有一个阻塞使轴变为负(为了打开所需的填充)。 但文档说它应该使轴更长,没有任何参考依赖于显示的数据,以及该数据相对于零。
此外,我不认为只是将其中一个数据值从略微正面变为略微负面就会产生如此巨大的影响。
我以为我理解了highcharts轴填充,但显然我没有!
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!
最满意答案
您应该将softThreshold参数设置为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] }]http://jsfiddle.net/wzkhuo9t
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] }]http://jsfiddle.net/wzkhuo9t
发布评论