答案 0 :(得分:0)
您可以包装exportChart
方法,并在不可见序列上将showInLegend
属性设置为false
:
var H = Highcharts;
H.wrap(H.Chart.prototype, 'exportChart', function(proceed, exportingOptions) {
var series = this.series;
Highcharts.each(series, function(s) {
if (s.visible) {
s.update({
showInLegend: true
}, false);
} else {
s.update({
showInLegend: false
}, false);
}
});
// which are sliced off this function's arguments
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
Highcharts.each(series, function(s) {
s.update({
showInLegend: true
}, false);
});
this.redraw();
});
答案 1 :(得分:0)
尝试一下:
series: [{
showInLegend: false,
name: 'Series',
data: value
}]