如何删除图表上方的 Empty space

How to remove Empty space above the chart

我正在使用 Highstock 显示图表,但它在图表上方显示不需要的空白 space,如下图所示。

图表 1: 禁用折线图(黑色)后,它仍然显示空 spaces,如下图所示。

图2:

但是当我禁用 Thermal Chart 时,它会删除图表上方的空白 space。

图3:

我的问题,我怎样才能删除图表 1 和图表 2 中不必要的 space,就像图表 3 中那样

图表 2 中不必要的 space 可以通过为该选项设置 chart.ignoreHiddenSeries to true (it is false by default). Here's the documentation 来删除:

If true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series. For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected. Defaults to true.

我建议禁用 alignTicks 选项并使用 tickPositioner。简单演示:http://jsfiddle.net/73hoqk8p/10