How can i hide all the Series in highcharts at a t

2019-03-27 14:00发布

问题:

I want to hide all the series's at a time , till now i use $.each hide all the series one by one but that degrading the performance i want hide all at a time..is there another way..? i had tried this..

$.each(series, function(index, series1) {
    series1.hide();
});

回答1:

Instead of .hide use .setVisible(false, false). This will not trigger a redraw after every hide operation.

$(chart.series).each(function(){
    //this.hide();
    this.setVisible(false, false);
});
chart.redraw();

See fiddle.