我希望一次只显示一个系列。
同时,我想禁用不显示任何系列的选项。
我找到了这个链接:http://forum.highcharts.com/viewtopic.php?f=9&t=6399,但是答案并不起作用。
我找到了这个链接:http://forum.highcharts.com/viewtopic.php?f=9&t=6399,但是答案并不起作用。
legendItemClick
。请参见:http://jsfiddle.net/tK38J/65/。plotOptions: {
series: {
events: {
show: function () {
var chart = this.chart,
series = chart.series,
i = series.length,
otherSeries;
while (i--) {
otherSeries = series[i];
if (otherSeries != this && otherSeries.visible) {
otherSeries.hide();
}
}
},
legendItemClick: function () {
if (this.visible) {
return false;
}
}
}
}
},
events: {
legendItemClick: function () {
if (this.visible) {
return false;
}else{
let series = this.chart.series,
i = series.length,
otherSeries;
while(i--) {
otherSeries = series[i]
if (otherSeries != this && otherSeries.visible) {
otherSeries.hide();
}
}
}
}
},