javascript - 声明图表上 Highcharts 条形的位置?

标签 javascript highcharts

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

enter image description here

这里是类似的 jsfiddle ;

Jsfiddle Link for similar case

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

我实际上可以在 xAxis 的 max: 上使用硬编码的 json 值来做到这一点。但我的 json 值取决于 年+月+日+小时+分钟+秒。因此,当此处的某些值发生更改时,我必须将硬编码值更改为其他值,所以它是不符合逻辑。

如果无论如何动态使用最大值请帮助我。

谢谢

最佳答案

解决方案是增加maxPaddingdemo .

有关 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.

关于javascript - 声明图表上 Highcharts 条形的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29247173/

相关文章:

javascript - 将自动变量传递给 JavaScript

javascript - 如何在 typescript 中使用 Highcharts.Tooltip 类型

javascript - plotOptions.series.point.events 在使用向下钻取时返回空点数据

javascript - 如何让 Highcharts 栏消失?

Highcharts.dateFormat ("%Y-%m-%d %H:%M",this.x) 不起作用

javascript - 触发div点击

Javascript:将变量传递给函数会导致未定义

java - 使用websocket的最大连接数

javascript - 如何创建 chrome(扩展)webRequest 监听器?

javascript - 组织结构图未显示所有标签