summaryrefslogtreecommitdiff
path: root/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic
diff options
context:
space:
mode:
authornoz (OpenERP) <noz@tinyerp.com>2011-07-13 15:02:09 +0530
committernoz (OpenERP) <noz@tinyerp.com>2011-07-13 15:02:09 +0530
commitbcccef82d08ce5ecc626fa6a47f2d13f854bf176 (patch)
treeb041d9716df0a55e283c3feee5c327c3cd8015f3 /addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic
parent59bb0fd4e637cd4100e53d24df184ad5c53ed86b (diff)
parent97966e8effa47972106d7f016532d80b64f96f99 (diff)
[Merge] Merged with main branch.
bzr revid: noz@tinyerp.com-20110713093209-3f2njjjhp0cgd5rj
Diffstat (limited to 'addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic')
-rw-r--r--addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html83
-rw-r--r--addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html96
-rw-r--r--addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html73
-rw-r--r--addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html81
4 files changed, 333 insertions, 0 deletions
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html
new file mode 100644
index 00000000000..7a3b45f8cee
--- /dev/null
+++ b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html
@@ -0,0 +1,83 @@
+<!--conf
+<sample>
+ <product version="2.6" edition="std"/>
+ <modifications>
+ <modified date="100609"/>
+ </modifications>
+ </sample>
+ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>Adding</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+ <script>
+ var data = [
+ { sales:"3.0", year:"2000" },
+ { sales:"3.8", year:"2001" },
+ { sales:"3.4", year:"2002" },
+ { sales:"4.1", year:"2003" },
+ { sales:"4.3", year:"2004" },
+ { sales:"9.9", year:"2005" },
+ { sales:"7.4", year:"2006" },
+ { sales:"9.0", year:"2007" },
+ { sales:"7.3", year:"2008" },
+ { sales:"4.8", year:"2009" }
+ ];
+
+ var barChart1;
+
+ window.onload = function(){
+ barChart1 = new dhtmlXChart({
+ view:"bar",
+ container:"chart1",
+ value:"#sales#",
+ label:"#sales#",
+ color:"#b3e025",
+ gradient:true,
+ border:false,
+ width:50,
+ tooltip:{
+ template:"#sales#"
+ },
+ xAxis:{
+ title:"Sales per year",
+ template:"#year#"
+ },
+ padding:{
+ top:20,
+ left:0,
+ right:0
+ }
+ });
+ barChart1.parse(data,"json");
+ }
+
+ var counter = 2010;
+ function add_new () {
+ barChart1.add({
+ year:counter,
+ sales:(Math.random()*5).toFixed(2)
+ });
+ counter++;
+ }
+ function delete_first(){
+ barChart1.remove(barChart1.first());
+ }
+ </script>
+</head>
+<body>
+ <table>
+ <tr>
+ <td><div id="chart1" style="width:750px;height:300px;border:1px solid #A4BED4;"></div></td>
+ </tr>
+ </table>
+
+
+
+
+ <input type="button" value="add" onclick="add_new()">
+ <input type="button" value="delete" onclick="delete_first()">
+</body>
+</html>
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html
new file mode 100644
index 00000000000..495d42bf795
--- /dev/null
+++ b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html
@@ -0,0 +1,96 @@
+<!--conf
+<sample>
+ <product version="2.6" edition="std"/>
+ <modifications>
+ <modified date="100609"/>
+ </modifications>
+ </sample>
+ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>Events</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+ <script>
+ var data = [
+ { sales:"3.0", year:"2000" },
+ { sales:"3.8", year:"2001" },
+ { sales:"3.4", year:"2002" },
+ { sales:"4.1", year:"2003" },
+ { sales:"4.3", year:"2004" },
+ { sales:"9.9", year:"2005" },
+ { sales:"7.4", year:"2006" },
+ { sales:"9.0", year:"2007" },
+ { sales:"7.3", year:"2008" },
+ { sales:"4.8", year:"2009" }
+ ];
+ var barChart1;
+ window.onload = function(){
+ barChart1 = new dhtmlXChart({
+ view:"bar",
+ container:"chart1",
+ value:"#sales#",
+ label:"#sales#",
+ color:"#b3e025",
+ gradient:true,
+ border:false,
+ width:50,
+ tooltip:{
+ template:"#sales#"
+ },
+ xAxis:{
+ title:"Sales per year",
+ template:"#year#"
+ },
+ padding:{
+ top:20,
+ left:0,
+ right:0
+ }
+ });
+ barChart1.parse(data,"json");
+ barChart1.attachEvent("onMouseMove", function(id){
+ id = barChart1.get(id).year;
+ log("onMouseMove", id);
+ return true;
+ });
+ barChart1.attachEvent("onMouseOut", function(id){
+ log("onMouseOut", id);
+ return true;
+ });
+
+ barChart1.attachEvent("onItemClick", function(id){
+ id = barChart1.get(id).year;
+ log("onItemClick", id);
+ return true;
+ });
+ barChart1.attachEvent("onItemDblClick", function(id){
+ id = barChart1.get(id).year;
+ log("onItemDblClick", id);
+ return true;
+ });
+
+ }
+
+ function log(name, id){
+ var t = document.createElement("DIV");
+ t.innerHTML = name+" for element "+id;
+
+ var p = document.getElementById("log_div");
+ p.insertBefore(t, p.firstChild);
+ }
+
+ </script>
+</head>
+<body>
+ <table>
+ <tr>
+ <td><div id="chart1" style="width:750px;height:300px;border:1px solid #A4BED4;"></div></td>
+ </tr>
+ </table>
+ <div id="log_div" style="widht:950px; height:300px; font-family:Tahoma;overflow:auto"></div>
+
+
+</body>
+</html>
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html
new file mode 100644
index 00000000000..cb8b254fe10
--- /dev/null
+++ b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html
@@ -0,0 +1,73 @@
+<!--conf
+<sample>
+ <product version="2.6" edition="std"/>
+ <modifications>
+ <modified date="100609"/>
+ </modifications>
+ </sample>
+ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>Sorting</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+ <script>
+ var data = [
+ { sales:"3.0", year:"2000" },
+ { sales:"3.8", year:"2001" },
+ { sales:"3.4", year:"2002" },
+ { sales:"4.1", year:"2003" },
+ { sales:"4.3", year:"2004" },
+ { sales:"9.9", year:"2005" },
+ { sales:"7.4", year:"2006" },
+ { sales:"9.0", year:"2007" },
+ { sales:"7.3", year:"2008" },
+ { sales:"4.8", year:"2009" }
+ ];
+
+ var barChart1;
+
+ window.onload = function(){
+ barChart1 = new dhtmlXChart({
+ view:"bar",
+ container:"chart1",
+ value:"#sales#",
+ label:"#sales#",
+ color:"#b3e025",
+ gradient:true,
+ border:false,
+ width:50,
+ tooltip:{
+ template:"#sales#"
+ },
+ xAxis:{
+ title:"Sales per year",
+ template:"#year#"
+ },
+ padding:{
+ top:20,
+ left:0,
+ right:0
+ }
+ });
+ barChart1.parse(data,"json");
+ }
+
+ </script>
+</head>
+<body >
+ <table>
+ <tr>
+ <td><div id="chart1" style="width:750px;height:300px;border:1px solid #A4BED4;"></div></td>
+ </tr>
+ </table>
+
+
+
+ <input type="button" value="sort by sales, ASC" onclick="barChart1.sort('#sales#','asc');">
+ <input type="button" value="sort by sales, DESC" onclick="barChart1.sort('#sales#','desc');">
+ <input type="button" value="sort by year, ASC" onclick="barChart1.sort('#year#','asc');">
+ <input type="button" value="sort by year, DESC" onclick="barChart1.sort('#year#','desc');">
+</body>
+</html>
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html
new file mode 100644
index 00000000000..230aa820800
--- /dev/null
+++ b/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html
@@ -0,0 +1,81 @@
+<!--conf
+<sample>
+ <product version="2.6" edition="std"/>
+ <modifications>
+ <modified date="100609"/>
+ </modifications>
+ </sample>
+ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>Filtering</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+ <script>
+ var data = [
+ { sales:"3.0", year:"2000" },
+ { sales:"3.8", year:"2001" },
+ { sales:"3.4", year:"2002" },
+ { sales:"4.1", year:"2003" },
+ { sales:"4.3", year:"2004" },
+ { sales:"9.9", year:"2005" },
+ { sales:"7.4", year:"2006" },
+ { sales:"9.0", year:"2007" },
+ { sales:"7.3", year:"2008" },
+ { sales:"4.8", year:"2009" }
+ ];
+
+ window.onload = function(){
+ barChart = new dhtmlXChart({
+ view:"bar",
+ container:"chart1",
+ value:"#sales#",
+ label:"#sales#",
+ color:"#b3e025",
+ gradient:true,
+ border:false,
+ width:50,
+ tooltip:{
+ template:"#sales#"
+ },
+ xAxis:{
+ title:"Sales per year",
+ template:"#year#"
+ },
+ padding:{
+ top:30,
+ left:0,
+ right:0
+ }
+ });
+ barChart.parse(data,"json");
+ }
+
+ function filter_year(){
+ barChart.filter(function(obj){
+ return obj.year >2005;
+ })
+ }
+ function filter_sales(){
+ barChart.filter(function(obj){
+ return obj.sales < 8;
+ })
+ }
+
+ </script>
+</head>
+<body>
+ <table>
+ <tr>
+ <td><div id="chart1" style="width:750px;height:300px;border:1px solid #A4BED4;"></div></td>
+ </tr>
+ </table>
+
+
+
+ <input type="button" value="show all" onclick="barChart.filter();">
+ <input type="button" value="show year > 2005" onclick="filter_year()">
+ <input type="button" value="show sales < 8" onclick="filter_sales()">
+</body>
+</html>