score:2

Accepted answer

you are initally creating a chart with a single blank series here:

series: [{
    data:[]
}]

chart.series[1] (a second series) and chart.series[2] (a third series) are therefore undefined.

a quick fix to your code could be:

var chart = $('#container').highcharts();
var series1 = [1, 52, 5, 98, 5, 929, 1, 9, 48];
var series2 = [1, 92, 35, 8, 25, 729, 61, 29, 38];
var series3 = [1, 59, 75, 26, 25, 829, 11, 19, 48];

chart.series[0].setdata(series1, false); // setdata on existing series, don't redraw
chart.addseries({data: series2}, false); // add new series, don't redraw
chart.addseries({data: series3}, true); // add new series, now redraw

not the boolean arguments to the above methods will control the redraw.

example here.


Related Query

More Query from same tag