Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding a highchart series is very slow

Tags:

highcharts

I have a highchart displaying multiple series, each contains 100+ data points I have a UI containing a checkbox for each series that when clicked calls the series.hide() or series.show() to toggle the hide/show of each line My problem is that the hide and show are extremely slow such that I cant check one checkbox whilst processing from a previous is taking place Does anyone know how to handle this? Thanks

like image 517
Britboy Avatar asked Dec 07 '22 09:12

Britboy


1 Answers

Rather than calling hide() for each series, call setVisible(false, false);. This second parameter is the redraw parameter, and you can avoid causing a redraw (which is slow) for each series.

Then, after you're done changing visibilities, call chart.redraw() once.

http://api.highcharts.com/highcharts#Series.setVisible

like image 71
philfreo Avatar answered Dec 08 '22 23:12

philfreo