Based on the information in this topic: Implement your own state - INACTIVE_STATE?
I built a chart that fits my needs - jsfiddle
I added some user controls to allow the user to show / hide all episodes and check / uncheck all episodes.
They all work fine.
The last part I want to do allows the user to reset the diagram with the initial parameters.
I also worked in this part, but there is a problem: after restoring the graph, the functions that allow the user to show / hide / check / take off no longer work, because I destroyed and re-set the variable that they are running away.
So my question is
- Is this the right way to destroy and rebuild a chart, or is there a better method?
- If this is the way to do this, then how do I get my show / hide / check / uncheck functions to continue working after that?
The reset code is given here:
//reset the chart to original specs $('#resetChart').click(function(){ chart1.destroy(); chart1 = new Highcharts.Chart(optionsChart1,highlightSer); });
highlightSer - callback function for highlighting specific series.
example code that no longer works after:
var chart = chart1; $('#showAll').click(function(){ for(i=0; i < chart.series.length; i++) { chart.series[i].show(); } });
thanks!
jlbriggs
source share