jqPlot: how to live update a chart

后端 未结 3 1495
鱼传尺愫
鱼传尺愫 2021-02-13 11:59

I\'m unable to figure out myself or find a proper example on how to perform live updates in jqPlot in a similar way as shown in this highcharts example.

3条回答
  •  故里飘歌
    2021-02-13 12:21

    var plot1;
    
    function updatePlot(data){
    plot1 = $.jqplot('myChart', [data], options);
    }
    
    
    function reDrawPlot(data){`
    updatePlot(data);
    plot1.replot();
    }
    
    ....
    initialize plot
    plot1 = $.jqplot('myChart', [data], options);
    ....
    
    
    call function reDrawPlot with the new data as a parameter
    

提交回复
热议问题