0
我有幾個陣列的數據,我想添加到高圖系列。當添加第二個或第三個數組得到一個錯誤或setData未定義。第一個系列繪製正確。Highcharts多個數據系列
$('#container').highcharts({
chart: {},
series: [{
data:[]
}]
});
function showChart() {
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];
var mySeries = [];
var chart = $('#container').highcharts();
chart.series[0].setData(series1);
chart.series[1].setData(series2);
chart.series[2].setData(series3);
chart.redraw();
}//end show chart