From c98d5145fe35eff1917ae25451e413cde551d6b9 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Thu, 2 Jul 2009 17:15:18 +0000 Subject: [PATCH] Added AJAX example git-svn-id: https://flot.googlecode.com/svn/trunk@174 1e0a6537-2640-0410-bfb7-f154510ff394 --- examples/ajax.html | 85 +++++++++++++++++++++++++++++ examples/data-eu-gdp-growth.json | 4 ++ examples/data-japan-gdp-growth.json | 4 ++ examples/data-usa-gdp-growth.json | 4 ++ examples/index.html | 4 +- 5 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 examples/ajax.html create mode 100644 examples/data-eu-gdp-growth.json create mode 100644 examples/data-japan-gdp-growth.json create mode 100644 examples/data-usa-gdp-growth.json diff --git a/examples/ajax.html b/examples/ajax.html new file mode 100644 index 0000000..1ee68f7 --- /dev/null +++ b/examples/ajax.html @@ -0,0 +1,85 @@ + + + + + Flot Examples + + + + + + +

Flot Examples

+ +
+ +

Example of loading data dynamically with AJAX. Percentage change in GDP (source: Eurostat). Click the buttons below.

+ +

The data is fetched over HTTP, in this case directly from text + files. Usually the URL would point to some web server handler + (e.g. a PHP page or Java/.NET/Python/Ruby on Rails handler) that + extracts it from a database and serializes it to JSON.

+ +

+ - + data - + +

+ +

+ - + data - + +

+ +

+ - + data - + +

+ + + + + diff --git a/examples/data-eu-gdp-growth.json b/examples/data-eu-gdp-growth.json new file mode 100644 index 0000000..e722bcc --- /dev/null +++ b/examples/data-eu-gdp-growth.json @@ -0,0 +1,4 @@ +{ + label: 'Europe (EU27)', + data: [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]] +} diff --git a/examples/data-japan-gdp-growth.json b/examples/data-japan-gdp-growth.json new file mode 100644 index 0000000..09aae77 --- /dev/null +++ b/examples/data-japan-gdp-growth.json @@ -0,0 +1,4 @@ +{ + label: 'Japan', + data: [[1999, -0.1], [2000, 2.9], [2001, 0.2], [2002, 0.3], [2003, 1.4], [2004, 2.7], [2005, 1.9], [2006, 2.0], [2007, 2.3], [2008, -0.7]] +} diff --git a/examples/data-usa-gdp-growth.json b/examples/data-usa-gdp-growth.json new file mode 100644 index 0000000..33fd4d3 --- /dev/null +++ b/examples/data-usa-gdp-growth.json @@ -0,0 +1,4 @@ +{ + label: 'USA', + data: [[1999, 4.4], [2000, 3.7], [2001, 0.8], [2002, 1.6], [2003, 2.5], [2004, 3.6], [2005, 2.9], [2006, 2.8], [2007, 2.0], [2008, 1.1]] +} diff --git a/examples/index.html b/examples/index.html index aa2b3ab..fbada6d 100644 --- a/examples/index.html +++ b/examples/index.html @@ -16,8 +16,8 @@

Being interactive: