我有两个系列数据,但是悬停时只能在标签上获得一个系列数据。 在x轴上悬停时是否可以在标签上同时包含两个数据?
Highcharts.chart('container', {
tooltip: {
crosshairs: true
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
Label has Series 1:176 and I want along with that Series 2:71.5
答案 0 :(得分:0)
您需要将tooltip.shared
参数设置为true。然后,所有定义的序列应在工具提示中可见。
Highcharts.chart('container', {
tooltip: {
crosshairs: true,
shared: true
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5]
}]
});