Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real Time data graph [closed]

I would like to build a web-based real time data graph and i'm looking at the different options such as:

  • Html5 canvas
  • JS libraries with graph support such as Extjs

By real time i mean, either the client polling the web server say every second or using reverse ajax; the server pushes data to the client when available.

Can you please recommend any?

like image 576
ken Avatar asked Sep 25 '10 06:09

ken


People also ask

What graph is best for over time?

Line graphs are used to track changes over short and long periods of time. When smaller changes exist, line graphs are better to use than bar graphs. Line graphs can also be used to compare changes over the same period of time for more than one group.

What is real time trend graphics used for?

Use cases for real-time graph analytics Real-time graph analytics can help turn data into insights immediately after it's collected. It can predict when your system is about to be breached.

How do you plot real time data?

To create a real-time plot, we need to use the animation module in matplotlib. We set up the figure and axes in the usual way, but we draw directly to the axes, ax , when we want to create a new frame in the animation.

What are real time charts?

Real-time charts take data coming from a data stream and plug it into various charts without delay. A variety of charts can be made to be real time, including real-time column, line, area, stacked area, stacked column, and line (dual y).


2 Answers

There is also SmoothieCharts that is designed more for this use-case.

like image 51
scoopr Avatar answered Oct 03 '22 13:10

scoopr


You may want to consider using Flot, an open-source plotting library based on jQuery.

I'm assuming that by real-time you mean that the graph will update automatically. The following is how your code would look like if you were to fetch and plot the data using AJAX polling at 1 second intervals:

function fetchData() {    $.ajax({       url:      'json_fetch_new_data.php',       method:   'GET',       dataType: 'json',       success:  function(series) {          var data = [ series ];           $.plot($('#placeholder'), data, options);       }    });     setTimeout(fetchData, 1000); } 

Make sure to check out the following demo to see it in action (Click on the "Poll for Data" button):

  • Flot Examples - Updating graphs with AJAX

For further information on Flot:

  • Flot Project Site
  • Flot Examples
  • Other Flot Examples
like image 21
Daniel Vassallo Avatar answered Oct 03 '22 11:10

Daniel Vassallo