我有这张图表
series: [
{
name: 'distance',
type: 'column',
data: [4.0, 0.0, 0.0, 5.0, 1.0, 0.0, 9.0],
borderRadius: 2
}, {
name: 'weight',
color: '#89A54E',
type: 'spline',
data: [165.0, 160.9, 159.5, 155.5, 162.2, 179.5, 125.2],
tooltip: {
valueSuffix: '--'
}
}
]
我想显示两个 yAxis 标签,一个在右侧,一个在左侧。好像只用了一个。
我认为这是由于自定义标签格式造成的,但不是积极的。我不希望两组数据使用相同的范围。有人知道为什么它只显示一个轴吗?
最佳答案
我一眼就能看出你有两个问题:
1.) 您尚未指定任何系列来根据第二个 y 轴进行绘图。
yAxis: 1
2.) 右边距为 -4,这会抑制右 y 轴的绘制。
marginRight: -4, // where's the axis going to draw if it doesn't have space?
已更新fiddle .
关于javascript - Highcharts - 双 y 轴不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17618130/