score:7

Accepted answer

this issue is the capitalization of our drop-down values. changed the check to do:

newtype = newtype.tolowercase();

now chart type changes great take effect. full code:

function changetype(chart, series, newtype) {
        newtype = newtype.tolowercase();
        for (var i = 0; i < series.length; i++) {
            series = series[0];
            try {
                series.chart.addseries({
                    type: newtype,
                    stack: series.stack,
                    yaxis: series.yaxis,
                    name: series.name,
                    color: series.color,
                    data: series.options.data
                },
                false);
                series.remove();
            } catch (e) {
                alert(newtype & ': ' & e);
            }
        }
    }

score:0

for anyone that stumbles accross this... you must remove the chart series' from last to first. also remember to redraw on the last series or your changes will not be displayed:)

function changecharttype(chart, type, redraw) {
    var seriesoptions = new array(chart.series.length);
    for (var i = 0; i < chart.series.length; i++) {
        var series = chart.series[i];
        seriesoptions[i] = {
            type: type,
            name: series.name,
            color: series.color,
            dashstyle: series.options.dashstyle,
            linewidth: series.options.linewidth,
            marker: series.options.marker,
            datalabels: series.options.datalabels,
            enablemousetracking: series.options.enablemousetracking,
            data: series.options.data,
            isregressionline: series.options.isregressionline
        };
    }
    for (var i = chart.series.length - 1; i >= 0; i--) {
        chart.series[i].destroy();
    }
    for (var i = 0; i < seriesoptions.length; i++) {
        var newseries = chart.addseries(seriesoptions[i], redraw && i == seriesoptions.length - 1);
    }
    chart.currenttype = type;
}

Related Query

More Query from same tag