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
16:07:40 up 52 days, 8:29, 0 user, load average: 0.08, 0.14, 0.24
Current bandwidth utilization   0.29 kbit/s