效果图如下:
核心代码如下:
chart: {
type: 'line',
events: {
load: function () {
let chart = this
const points = []
Highcharts.each(chart.series, function (s) {
if (s.visible) {
points.push(s.points[s.points.length - 1])
}
})
chart.tooltip.refresh(points)
},
},
},
tooltip: {
shared: true
}
}