Highcharts 绘制 MACD + EMA + 交易量

Highcharts plot MACD + EMA + Volume

我正在使用 highcharts 上提供的示例并尝试绘制 EMA、MACD 和交易量。但是,MACD 不会显示任何内容。这是我到目前为止尝试过的 - chart

Code sample in the chart link above

此外,在添加多个面板的情况下,有没有一种方法可以自动适应所有面板而不是指定百分比高度?

如有任何帮助,我将不胜感激。

macd 指标显示在第二个窗格中,但与成交量系列相比,数值非常小,macd 只是一条平坦的绿线。

您需要将 macd 指标分配给不同的 y 轴。

series: [..., {
  type: 'macd',
  yAxis: 2,
  linkedTo: 'aapl'
}, ...]

现场演示: https://jsfiddle.net/BlackLabel/Loqrua4w/


关于你的第二个问题:

Also, in case of adding multiple panels, is there a way to auto fit all the panels instead of specifying height in percentage?

Highcharts 中没有这样的逻辑,但您可以通过自己的脚本轻松计算百分比值。