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!
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!
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