核心代码如下:
plotOptions: {
series: {
events: {
show: function () {
const chart = this.chart
const series = chart.series
let i = series.length
let otherSeries
while (i--) {
otherSeries = series[i];
if (otherSeries != this && otherSeries.visible) {
otherSeries.hide();
}
}
},
legendItemClick: function () {
if (this.visible) {
return false;
}
}
}
}
},