1
我有一個Highchart,通過AJAX和jQuery在setInterval函數中接收JSON數據,當我使用series.data[i].y = response[i].y
時,y的值是變化,但劑量顯示在圖表中,點的高度有前值,但在工具提示中顯示最近值?和x值doseng changhe在所有,請幫助我如何更新x和y值,如果它變動?如何更新Highchart中的點值?
chart:{ renderTo: 'container',
zoomType: 'xy',
plotBackgroundImage: 'graphics/skies.jpg',
events: {
load: function() {
var series = this.series[0];setInterval(function() {ajax({type: "POST",url: "/Home/GetData",data: null),contentType: "application/json; charset=utf-8",success: function (response) { for (var i = 0; i < response.length; i++) { if (series.data[i].y =response[i].y || series.data[i].category != response[i].x) { series.data[i].y =response[i].y; series.data[i].category = response[i].x;} }}, dataType: "json",failure: ajaxCallFailed });}, 50000);}