我想使用Highcharts圖並動態更新y軸。其實我想每5秒更新一次nsw,Tas,ACT。我該怎麼做 ?如何在一段時間內動態更新Highcharts數據
這是我的代碼。
$(function() {
$('#container').highcharts({
title: {
text: 'Histogram',
x: -20 // center
},
subtitle: {
text: 'Source: www.trove.com',
x: -20
},
xAxis: {
categories: ['NSW', 'Tas', 'ACT','QLD','VIC','SA','WA']
},
yAxis: {
title: {
text: 'Hits'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '°C'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'States',
data: [nsw, Tas, ACT,qld,vic,sa,wa]
}]
});
});
});
好吧,我已經檢查過它,它會更新x軸和y軸!我只需要更新y軸 – Amir