I have an issue regarding with my drilldown charts..
Here is the link: http://jsfiddle.net/sSLnn/3/
chartfunc = function()
{
var column = document.getElementById('column');
var bar = document.getElementById('bar');
var pie = document.getElementById('pie');
var line = document.getElementById('line');
if(column.checked)
{
options.chart.renderTo = 'container';
options.chart.type = 'column';
var chart1 = new Highcharts.Chart(options);
}
else if(bar.checked)
{
options.chart.renderTo = 'container';
options.chart.type = 'bar';
var chart1 = new Highcharts.Chart(options);
}
else if(pie.checked)
{
options.chart.renderTo = 'container';
options.chart.type = 'pie';
var chart1 = new Highcharts.Chart(options);
}
else
{
options.chart.renderTo = 'container';
options.chart.type = 'line';
var chart1 = new Highcharts.Chart(options);
}
}
In my chart I can change its type successfully with 4 radio buttons, however when i am in drill down series state then change the type of chart it will load to the original series state.. Is it possible when i change the type of the chart if i am in drill down series state it will change the type and the data will still remains?
For change any series to bar chart you need to destroy and recreate chart (as you do right now). When destroying chart and creating new one, we don't have information about drilldown anymore. You will need to store series which was drilleddown and call: chart.addSeriesAsDrilldown(e.point, series);
after recreating chart.
For all other types, you can use chart.series[0].update({ type: new_type });
, just like this: http://jsfiddle.net/sSLnn/4/