0
我使用highcharts time series,我需要添加從另一個json文件/鏈接填充的另一個數據系列,這可能嗎?在一個高圖中添加兩個json數據系列
這裏是我的代碼:
$(function() {
$.getJSON('myfirstjson', function (data) {
mydata = [];
$('#tvmtgm').highcharts({
chart: {
zoomType: 'x'
},
title: {
text: 'TVM/TGM'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats : {
hour: '%I %p',
minute: '%I:%M %p'
}
},
yAxis: {
title: {
text: 'Moves'
}
},
legend: {
enabled: false
},
plotOptions: {
area: {
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
marker: {
radius: 2
},
lineWidth: 1,
states: {
hover: {
lineWidth: 1
}
},
threshold: null
}
},
series: [{
type: 'area',
name: 'Total vessel moves',
data: data
}
]
});
});
});
有在highcharts網站上的例子,但它們都是靜態的數據系列,我需要從JSON填充兩個數據系列的請求
請參閱[本演示](http://www.highcharts.com/stock/demo/compare)。 –