具有多个 Y 轴的 HighCharts 绘图线
HighCharts Plotlines with Multiple Y-Axis
我已经能够像这样生成具有多个 y 轴的 HighCharts 图表 chart with multiple y-axis and I have been able to generate a chart with a single y-axis and plot line like this chart with plot lines and single y-axis。是否可以将两者结合起来,以便我可以拥有多个 y 轴和至少一条绘图线?我不确定从哪里开始。
提前致谢,
是的。您应该简单地组合每个图表选项的代码。在您想要绘图线的轴中包含 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
我已经能够像这样生成具有多个 y 轴的 HighCharts 图表 chart with multiple y-axis and I have been able to generate a chart with a single y-axis and plot line like this chart with plot lines and single y-axis。是否可以将两者结合起来,以便我可以拥有多个 y 轴和至少一条绘图线?我不确定从哪里开始。
提前致谢,
是的。您应该简单地组合每个图表选项的代码。在您想要绘图线的轴中包含 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