score:7

Accepted answer

The .update() method only updates the options of the existing series. To update I think you need to remove the existing series and then add the new series one at a time. An alternative would be to remove the chart and recreate it with the new data. I show the first one were an update is done below:

$('#button').click(function () {
        var chart = $('#container').highcharts();
        var new_serie = [{
            "name": "Production",
                "data": [3.5],
                "color": "green"
        }, {
            "name": "Changeover",
                "data": [3.5],
                "color": "lightblue"
        }, {
            "name": "Technical Failure",
                "data": [5],
                "color": "red"
        }];
        //alert(new_serie); // returns objects
        for (var i = chart.series.length-1; i>=0; i--) {
            chart.series[i].remove();
        }
        for (var y = new_serie.length-1; y >= 0; y--) {
            chart.addSeries(new_serie[y]);
        }
    });

Check this fiddle: http://jsfiddle.net/BhC4J/1/


Related Query

More Query from same tag