如何关联不同类型图表的y轴?
How to relate the y-axis of different types of graphs?
我想将两种类型的图形合二为一,并且两者在 y 轴上使用相同的类别。
//My code
https://jsfiddle.net/cyt8caLz/
感谢您的帮助。
为此,您可以使用 yAxis.linkedTo
属性。来自文档:
Index of another axis that this axis is linked to. When an axis is
linked to a master axis, it will take the same extremes as the master,
but as assigned by min or max or by setExtremes. It can be used to
show additional info, or to ease reading the chart by duplicating the
scales.
所以你可以这样做:
...
yAxis: [{ // Primary yAxis
max: 100,
gridLineWidth: 0,
title: {
text: null
},
tickInterval: 10
}, { // Secondary yAxis
title: {
text: 'Toneladas'
},
linkedTo: 0
}],
...
我想将两种类型的图形合二为一,并且两者在 y 轴上使用相同的类别。
//My code
https://jsfiddle.net/cyt8caLz/
感谢您的帮助。
为此,您可以使用 yAxis.linkedTo
属性。来自文档:
Index of another axis that this axis is linked to. When an axis is linked to a master axis, it will take the same extremes as the master, but as assigned by min or max or by setExtremes. It can be used to show additional info, or to ease reading the chart by duplicating the scales.
所以你可以这样做:
...
yAxis: [{ // Primary yAxis
max: 100,
gridLineWidth: 0,
title: {
text: null
},
tickInterval: 10
}, { // Secondary yAxis
title: {
text: 'Toneladas'
},
linkedTo: 0
}],
...