How can I stream live data and present it in a line chart using PHP, cURL, ajax How can I stream live data and present it in a line chart using PHP, cURL, ajax curl curl

How can I stream live data and present it in a line chart using PHP, cURL, ajax


I suggest you to use Google Charts's Line plot. See this jsFiddle example of how to add data automatically. This is simple as using the data.addRow([ DATA_INDEX, VALUE_1, VALUE_2, ... ]);

This use jQuery for plot initialization and "click" event. You'll have to make a loop in order to retrieve data and add it to the plot.


Any of the various JS chart libraries out there should be able to present a line chart for you via loading data up through ajax calls. Here are a few:

http://www.fusioncharts.com

http://www.chartjs.org

http://www.jscharts.com

http://www.amcharts.com

... and there are plenty more. Just find one that works best for you.

To run the ajax call that refreshes the charts every x-seconds, use something like this:

Call jQuery Ajax Request Each X Minutes

Also, take a look at this answer on the amCharts forum:http://www.amcharts.com/forum/viewtopic.php?id=12625