diff options
| author | Antony Lesuisse <al@openerp.com> | 2011-09-05 13:03:09 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2011-09-05 13:03:09 +0200 |
| commit | bedfc48dcfb066e61209337235e339975dd093d0 (patch) | |
| tree | fd1bab7b9f21380f1aa3ca7675018f13b4d9e652 /addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization | |
| parent | 272424894a91aa136952cf88ef206afab5b5505c (diff) | |
rename base into web part1
bzr revid: al@openerp.com-20110905110309-egx167t1ni1fzho1
Diffstat (limited to 'addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization')
5 files changed, 385 insertions, 0 deletions
diff --git a/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html new file mode 100644 index 00000000000..e720ba8ee3e --- /dev/null +++ b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html @@ -0,0 +1,70 @@ +<!--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>Data Loading: XML</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+
+ <style>
+ .dhx_chart_title{
+ padding-left:3px
+ }
+ </style>
+
+ <script>
+ var barChart;
+ window.onload=function(){
+ barChart = new dhtmlXChart({
+ view:"bar",
+ container:document.getElementById("chart_container"),
+ value:"#sales#",
+ label:"#year#",
+ padding:{
+ bottom:0,
+ right:0,
+ left:0
+ },
+ width:30,
+ gradient:true,
+ border:false
+ })
+ barChart.load("../common/sales.xml");
+
+ var barChart2 = new dhtmlXChart({
+ view:"pie",
+ container:"chart_container2",
+ value:"#sales#",
+ details:"#year#"
+ });
+ barChart2.load("../common/sales.xml");
+ }
+ function reloada(){
+
+ barChart.destructor();
+ barChart = new dhtmlXChart({
+ view:"pie",
+ container:"chart_container",
+ value:"#sales#",
+ details:"#year#"
+ })
+ barChart.load("../common/sales.xml");
+ }
+
+ </script>
+</head>
+<body>
+ <p>Chart data can be loaded from different sources: xml,json,JS array,csv<br/> This samples demonstrates loading from xml file.</p>
+ <div id="chart_container" style="width:450px;height:300px;border:1px solid #A4BED4;float:left;margin-right:20px"></div>
+ <div id="chart_container2" style="width:450px;height:300px;border:1px solid #A4BED4;"></div>
+
+ <input type="button" name="some_name" value="reload" onclick="reloada()">
+</body>
+</html>
diff --git a/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html new file mode 100644 index 00000000000..e2ce20ae764 --- /dev/null +++ b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html @@ -0,0 +1,63 @@ +<!--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>Data Loading: JSON</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+
+ <style>
+ .dhx_chart_title{
+ padding-left:3px
+ }
+ </style>
+ <script>
+ var data = [
+ { value:"2.9", label:"2000" },
+ { value:"3.5", label:"2001" },
+ { value:"3.1", label:"2002" },
+ { value:"4.2", label:"2003" },
+ { value:"4.5", label:"2004" },
+ { value:"9.6", label:"2005" },
+ { value:"7.4", label:"2006" },
+ { value:"9.0", label:"2007" },
+ { value:"7.3", label:"2008" },
+ { value:"2.8", label:"2009" }
+ ];
+ window.onload = function(){
+ var barChart = new dhtmlXChart({
+ view:"bar",
+ container:"chart_container",
+ label:"#label#",
+ padding:{
+ bottom:0,
+ right:0,
+ left:0
+ },
+ width:30,
+ gradient:true,
+ border:false
+ })
+ barChart.parse(data,"json");
+
+ var barChart2 = new dhtmlXChart({
+ view:"pie",
+ container:"chart_container2",
+ details:"#label#"
+ });
+ barChart2.parse(data,"json");
+ }
+ </script>
+</head>
+<body>
+ <div id="chart_container" style="width:450px;height:300px;border:1px solid #A4BED4;float:left;margin-right:20px"></div>
+ <div id="chart_container2" style="width:450px;height:300px;border:1px solid #A4BED4;"></div>
+</body>
+</html>
diff --git a/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html new file mode 100644 index 00000000000..64c39cfaef1 --- /dev/null +++ b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html @@ -0,0 +1,65 @@ +<!--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>Data Loading: CSV</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+
+ <style>
+ .dhx_chart_title{
+ padding-left:3px
+ }
+ </style>
+ <script>
+ var data = "\
+ 2.9, 2000\n\
+ 3.5, 2001\n\
+ 3.1, 2002\n\
+ 4.2, 2003\n\
+ 4.5, 2004\n\
+ 9.6, 2005\n\
+ 7.4, 2006\n\
+ 9.0, 2007\n\
+ 7.3, 2008\n\
+ 2.8, 2009";
+ window.onload = function(){
+ var barChart = new dhtmlXChart({
+ view:"bar",
+ container:"chart_container",
+ value:"#data0#",
+ label:"#data1#",
+ padding:{
+ bottom:0,
+ right:0,
+ left:0
+ },
+ width:30,
+ gradient:true,
+ border:false
+ })
+ barChart.parse(data,"csv");
+
+ var barChart2 = new dhtmlXChart({
+ view:"pie",
+ container:"chart_container2",
+ value:"#data0#",
+ details:"#data1#"
+ });
+ barChart2.parse(data,"csv");
+ }
+ </script>
+</head>
+<body>
+<p>When data are loaded from CSV string, you should use "data" and field index to define field in the template, for example, "#data0#","#data1#",etc.<br/>Charts in this sample represents values in the first column. Therefore, we have set value:"#data0#" in a chart contructor.</p>
+ <div id="chart_container" style="width:450px;height:300px;border:1px solid #A4BED4;float:left;margin-right:20px"></div>
+ <div id="chart_container2" style="width:450px;height:300px;border:1px solid #A4BED4;"></div>
+</body>
+</html>
diff --git a/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html new file mode 100644 index 00000000000..023cb0a503a --- /dev/null +++ b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html @@ -0,0 +1,68 @@ +<!--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>Data Loading: JS array</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+
+ <style>
+ .dhx_chart_title{
+ padding-left:3px
+ }
+ </style>
+ <script>
+ var data = [
+ [ "2.9", "2000" ],
+ [ "3.5", "2001" ],
+ [ "3.1", "2002" ],
+ [ "4.2", "2003" ],
+ [ "4.5", "2004" ],
+ [ "9.6", "2005" ],
+ [ "7.4", "2006" ],
+ [ "9.0", "2007" ],
+ [ "7.3", "2008" ],
+ [ "2.8", "2009" ]
+ ];
+ window.onload = function(){
+ var barChart = new dhtmlXChart({
+ view:"bar",
+ container:"chart_container",
+ value:"#data0#",
+ label:"#data1#",
+ padding:{
+ bottom:0,
+ right:0,
+ left:0
+ },
+ width:30,
+ gradient:true,
+ border:false
+ })
+ barChart.parse(data,"jsarray");
+
+ var barChart2 = new dhtmlXChart({
+ view:"pie",
+ container:"chart_container2",
+ value:"#data0#",
+ details:"#data1#"
+ });
+ barChart2.parse(data,"jsarray");
+ }
+ </script>
+
+</head>
+<body>
+ <p>When data are loaded from JS array, you should use "data" and field index to define field in the template, for example, "#data0#","#data1#",etc.<br/>Charts in this sample represents values in the first column. Therefore, we have set value:"#data0#" in a chart contructor.</p>
+ <div id="chart_container" style="width:450px;height:300px;border:1px solid #A4BED4;float:left;margin-right:20px"></div>
+ <div id="chart_container2" style="width:450px;height:300px;border:1px solid #A4BED4;"></div>
+
+</body>
+</html>
diff --git a/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html new file mode 100644 index 00000000000..0600c05741d --- /dev/null +++ b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html @@ -0,0 +1,119 @@ +<!--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>PieChart: Initiazation</title>
+ <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
+ <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
+</head>
+<body >
+ <h1>BarChart: Scales</h1>
+
+ <table>
+ <tr>
+ <td>Automatic vertical scale</td>
+ <td>Custom vertical scale</td>
+ </tr>
+ <tr>
+ <td><div id="chart1" style="width:450px;height:300px;border:1px solid #A4BED4;"></div></td>
+ <td><div id="chart2" style="width:350px;height:300px;border:1px solid #A4BED4;"></div></td>
+ </tr>
+ </table>
+
+
+ <script>
+ var data = [
+ { sales:"3.0",sales1:"3.4",sales2:"1.2",sales3:"6.9", year:"2000" },
+ { sales:"3.8",sales1:"4.5",sales2:"2.5",sales3:"7.5", year:"2001" },
+ { sales:"3.4",sales1:"4.7",sales2:"1.9",sales3:"5.5", year:"2002" }
+ ];
+
+
+
+ var barChart1 = new dhtmlXChart({
+ view:"bar",
+ container:"chart1",
+ value:"#sales#",
+ label:"#sales#",
+ width:30,
+ tooltip:{
+ template:"#sales#"
+ },
+ xAxis:{
+ title:"Sales per year",
+ template:"#year#"
+ },
+ yAxis:{
+ title:"Sales,million"
+ },
+ gradient:true,
+ border:false,
+ color: "#66cc33"
+ })
+ barChart1.addSeries({
+ value:"#sales1#",
+ color:"#ff9933",
+ label:"#sales1#"
+ });
+ barChart1.addSeries({
+ value:"#sales2#",
+ color:"#ffff99",
+ label:"#sales2#"
+ });
+ barChart1.parse(data,"json");
+
+
+
+
+ var barChart2 = new dhtmlXChart({
+ view:"bar",
+ container:"chart2",
+ value:"#sales#",
+ gradient:true,
+ border:false,
+ width:30,
+ color: "#66cc33",
+ label:"#sales#",
+ tooltip:{
+ template:"#sales#"
+ },
+ xAxis:{
+ title:"Years",
+ template:"#year#"
+ },
+ yAxis:{
+ start: 0,
+ end: 10,
+ step: 1,
+ title:"Sales, mil"
+ }
+
+ });
+ barChart2.addSeries({
+ value:"#sales1#",
+ color:"#ff9933",
+ label:"#sales1#"
+ });
+ barChart2.addSeries({
+ value:"#sales2#",
+ color:"#ffff99",
+ label:"#sales2#"
+ });
+ barChart2.addSeries({
+ value:"#sales3#",
+ color:"#ccff99",
+ label:"#sales3#"
+ });
+
+ barChart2.parse(data,"json");
+
+ </script>
+</body>
+</html>
|
