score:0

Accepted answer

highcharts for performance mutates an original data array, so data values in data1 variable are the same as in series variable after first update. as a solution you need to create a new array with data, for examply by returning it from a function.

    function getdata1() {
        return [...]
    }

    function getseries() {
        return [...]
    }

    $('#container').highcharts({
        series: getdata1()
    });

    // for new data
    $('#new').click(function() {
        ...
        chart.update({
            series: getseries()
        });
    });

    //back to same series
    $('#previous').click(function() {
        ...
        chart.update({
            series: getdata1()
        });
    });

live demo: http://jsfiddle.net/blacklabel/qk3rla5v/


Related Query

More Query from same tag