highcharts Highchart的Y轴标签的不可预测行为

sq1bmfud  于 2022-11-10  发布在  Highcharts
关注(0)|答案(1)|浏览(175)
Hope someone can explain the logic behind the following Highcharts behavior:
1. As seen in the jsFiddle, Y-axis label is till 25 though it can stop at 20 as the highest positive value  is 19.
2. I have used endOnTick:  which solved this problem but arises new one.
3. Again I used maxPadding and minPadding but it doesn't solve the issue for all the cases.
I am unable to understand the underlying logic. Can anyone please provide solution?

https://jsfiddle.net/3rLd5guf/1/
https://jsfiddle.net/3rLd5guf/2/
https://jsfiddle.net/3rLd5guf/3/
如图所示,y轴刻度不应在10处停止,因为存在高于10的值,例如五月

sbdsn5lh

sbdsn5lh1#

使用maxPadding: 0,不要禁用endOnTick选项。没有填充,禁用endOnTickyAxis.max计算为19,这就是它没有显示的原因。

yAxis: [{
    maxPadding: 0,
    ...
  }]

现场演示:https://jsfiddle.net/BlackLabel/k7420gjL/
API引用:https://api.highcharts.com/highstock/yAxis.maxPadding

相关问题