From 770ba5201f5c60b2bb36602ff9d359f641e33125 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 23 Oct 2011 21:14:40 +0200 Subject: Charting with flask, rgraph and custom "timeseries database" --- schall/static/RGraph/docs/annotate_persist.html | 303 ++++++++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 schall/static/RGraph/docs/annotate_persist.html (limited to 'schall/static/RGraph/docs/annotate_persist.html') diff --git a/schall/static/RGraph/docs/annotate_persist.html b/schall/static/RGraph/docs/annotate_persist.html new file mode 100644 index 0000000..c4d4f9d --- /dev/null +++ b/schall/static/RGraph/docs/annotate_persist.html @@ -0,0 +1,303 @@ + + + + + + RGraph: HTML5 Javascript charts library - Making annotations shareable cross browser + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Mention RGraph on Twitter + +
+ + + +
+ + +
+ + + + +

RGraph: HTML5 Javascript charts library - Making annotations shareable cross browser

+ +
+
+ This example does not work offline - you must use a website. Annotations are removed every five minutes. +
+
+ + + + [No canvas support] + +

+ Combining a little AJAX and some very simple server side scripting, you can easily make an annotation system that can persist + across different browsers and computers. You an either use Load/Save buttons to trigger the loading and saving, or like the + example to the right you can make use of the custom RGraph onannotateend event to make it happen automatically. +

+ +

+ This simple example uses a small PHP server side script that loads and saves the annotation data to a file on the server, + and that looks like this: +

+ +
+ +
+<?php
+    $file = '/tmp/annotation_data';
+
+    /**
+    * Save the annotations to a tmp file
+    */
+    if (isset($_POST) && isset($_POST['data'])) {
+        file_put_contents($file, $_POST['data']);
+        exit;
+    }
+
+
+    /**
+    * Load the annotations
+    */
+    if (!empty($_GET['getannotations']) && $_GET['getannotations'] == 1) {
+        $contents = file_get_contents($file);
+        print($contents);
+        exit;
+    }
+?>
+
+ +

+ By making the Javascript Save/Load functions repeat themselves every few seconds, you could easily make a presentation/demo system + that can be used when paticipants are in differing locations - in a similar fashion to Google Docs - or when you want one persons + annotations to be viewable by multiple PCs. On this page though, the Save function is triggered by the custom RGraph event + onannotateend. +

+ + + \ No newline at end of file -- cgit v1.2.1