diff options
| author | Vidhin Mehta (OpenERP) <vme@tinyerp.com> | 2011-09-14 11:07:46 +0530 |
|---|---|---|
| committer | Vidhin Mehta (OpenERP) <vme@tinyerp.com> | 2011-09-14 11:07:46 +0530 |
| commit | b6076c3cc3ca5141349b99821268b8fd5e148b77 (patch) | |
| tree | bb875d3ef5127cf5b8c35de6475de14e5477dbbd /addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic | |
| parent | 243e1bdb0079ea9f214696ead8228d464ecb2cfc (diff) | |
| parent | c7c2b5846d3775780bbaa9a84a93ad755bdb8756 (diff) | |
[Merge] upto revno 1024.
bzr revid: vme@tinyerp.com-20110914053746-ri6d5s341mm6tc7n
Diffstat (limited to 'addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic')
4 files changed, 333 insertions, 0 deletions
diff --git a/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html new file mode 100644 index 00000000000..7a3b45f8cee --- /dev/null +++ b/addons/web_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/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html new file mode 100644 index 00000000000..495d42bf795 --- /dev/null +++ b/addons/web_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/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html new file mode 100644 index 00000000000..cb8b254fe10 --- /dev/null +++ b/addons/web_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/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html new file mode 100644 index 00000000000..230aa820800 --- /dev/null +++ b/addons/web_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>
|
