I am using Highcharts to render some graphs to my website. Sometimes, I need to remove all series from the chart and add some new series to the chart, because I requested so
You can use my custom solution which reset colors in each click event.
http://jsfiddle.net/sbochan/gJvde/1/
function setColors(chart){
var series = chart.series,
colors = chart.options.colors,
len = series.length-1;
if(flag) {
$.each(series,function(i,serie){
if(i==len) {
flag != flag;
serie.update({
color: colors[i]
},true,true);
}
else {
serie.update({
color: colors[i]
},false);
}
});
}
}