在图表上声明高图条的位置?

Declaring location of highchart bars on a chart?

我有 highchart,它看起来像这样;[如果我注释掉 xAxis 的最大值,我会在下面看到这张图片]

这是类似的jsfiddle ;

Jsfiddle Link for similar case

我想将条形图一直推到图表的左侧。

我实际上可以使用 xAxis 的 max: 上的硬编码 json 值来做到这一点。但是我的 json 值取决于 year+month+day+hours+min+sec. 所以当这里的一些值发生变化时,我必须将硬编码值更改为其他值,所以这是不合逻辑的。

如果有动态使用最大值请帮助我。

谢谢

解决方法是增加maxPadding,demo.

API 中关于 maxPadding 的更多信息:

Padding of the max 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 highest data value to appear on the edge of the plot area. When the axis' max option is set or a max extreme is set using axis.setExtremes(), the maxPadding will be ignored. Defaults to 0.01.