From a095971b6d416e2f011605c9702c98fbb437d087 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Thu, 17 Mar 2011 16:38:16 +0000 Subject: [PATCH] Add example of how to update a chart real-time (using the random walk data generation idea from Doug Suerich's test case on issue 387) git-svn-id: https://flot.googlecode.com/svn/trunk@320 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 1 + examples/index.html | 2 +- examples/realtime.html | 83 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 examples/realtime.html diff --git a/NEWS.txt b/NEWS.txt index 66ea834..128fe02 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -101,6 +101,7 @@ Changes: and hopefully makes replotting faster for those who are using $.plot instead of .setData()/.draw(). Also update jQuery to 1.5.1 to prevent IE leaks fixed in jQuery. +- New real-time line chart example. - New hooks: drawSeries, shutdown diff --git a/examples/index.html b/examples/index.html index e65c27c..f24f750 100644 --- a/examples/index.html +++ b/examples/index.html @@ -14,7 +14,7 @@
  • Basic example
  • Different graph types
  • Setting various options and annotating a chart
  • -
  • Updating graphs with AJAX
  • +
  • Updating graphs with AJAX and real-time updates
  • Being interactive:

    diff --git a/examples/realtime.html b/examples/realtime.html new file mode 100644 index 0000000..3b427e1 --- /dev/null +++ b/examples/realtime.html @@ -0,0 +1,83 @@ + + + + + Flot Examples + + + + + + +

    Flot Examples

    + +
    + +

    You can update a chart periodically to get a real-time effect + by using a timer to insert the new data in the plot and redraw it.

    + +

    Time between updates: milliseconds

    + + + + +