【问题标题】:HighCharts Plotlines with Multiple Y-Axis具有多个 Y 轴的 HighCharts 绘图线
【发布时间】:2015-05-18 02:15:39
【问题描述】:

我已经能够生成具有多个 y 轴的 HighCharts 图表,例如 chart with multiple y-axis,并且我已经能够生成具有单个 y 轴的图表并绘制线,例如 chart with plot lines and single y-axis。是否可以将两者结合起来,以便我可以拥有多个 y 轴和至少一条绘图线?我不确定从哪里开始。

提前致谢,

【问题讨论】:

  • 您是否尝试将绘图线代码添加到您的多 y 轴图表?这就是你需要做的一切:)

标签: highcharts


【解决方案1】:

是的。您应该简单地组合每个图表选项的代码。将 plotLines 包含在您希望 plotLines 所在的轴中:

{ // Secondary yAxis
        plotLines: [{
            value: 50,
            color: 'green',
            dashStyle: 'shortdash',
            width: 2,
            zIndex: 10,
            label: {
                text: 'Minimum'
            }
        }, {
            value: 150,
            color: 'red',
            dashStyle: 'shortdash',
            width: 2,
            zIndex: 10,
            label: {
                text: 'Maximum'
            }
        }],

        ...
}

这是DEMO

【讨论】:

  • 非常感谢@Raeen Hashemi!这完美地回答了我的问题!昨晚我差点搞定,但睡眼惺忪的眼睛无法解析所有的逗号、括号、括号和分号。 :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-11-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多