AJAX and JSON Data Loading via Data Renderers

Data renderers allow jqPlot to pull data from any external source (e.g. a function implementing an AJAX call). Simply assign the external source to the "dataRenderer" plot option. The only requirement on data renderers is that it must return a valid jqPlot data array.




Data renderers get passed options by the plot. The signiture for a data renderer is:

function(userData, plotObject, options) {
  ...
  return data;
}

Where userData is whatever data was passed into the plot, plotObject is a reference back to the plot itself, and options are any options passed into the plots "dataRendererOption" option. The following example shows a more complicated example which uses ajax pulls data from an external json data source.






  








    
    
    
    




    



        

/Server/Sensoren/jqplot/examples/data-renderers.html: letzte Änderung am: 05.09.2016 um 00:08
02:10:19 up 292 days, 16:16, 0 user, load average: 0.30, 0.28, 0.28
Current bandwidth utilization   0.29 kbit/s