2

Here is my demo

const seriesAmount = 90;

When the variable 「seriesAmount」 is < 50,

everything works smoothly,

but when it's > 50,

you have to wait such a long time to Unselect them.

Is there a better solution to fix this problem?Thanks!

9100bo
  • 27
  • 4

1 Answers1

1

In this case it is better to use setVisible method (called internally by show/hide). It gives a possibility to control chart redraw process. By using hide/show chart is redrawing in every iteration.

btn.addEventListener('click', () => {
    for (let i = 0; i < seriesAmount; i++) {
        chart.series[i].setVisible(undefined, false);
    }

    chart.redraw();
});

Live demo: https://jsfiddle.net/BlackLabel/f3L4oyqa/

API Reference: https://api.highcharts.com/class-reference/Highcharts.Series#setVisible

ppotaczek
  • 36,341
  • 2
  • 14
  • 24