Debian Codegraph @

dojox/charting/tests/gradients/test_grad_bars2.html

raw symbols SCIP
1 <!--[if IE 7]>
2 <!DOCTYPE>
3 <html lang="en">
4 <head>
5 <![endif]-->
6 <!--[if IE 8]>
7 <!DOCTYPE>
8 <html lang="en">
9 <head>
10 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
11 <![endif]-->
12 <![if gte IE 9]>
13 <!DOCTYPE HTML>
14 <html lang="en">
15 <head>
16 <![endif]>
17 <![endif]>
18 <title>Gradient: Bars #2</title>
19 <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script>
20 <script>
21 dojo.require("dojox.charting.Chart");
22 dojo.require("dojox.charting.axis2d.Default");
23 dojo.require("dojox.charting.plot2d.Bars");
24 dojo.require("dojox.charting.plot2d.ClusteredBars");
25 dojo.require("dojox.charting.plot2d.StackedBars");
26 dojo.require("dojox.charting.Theme");
27
28 run = function(){
29 dojo.attr("start", "disabled", true);
30
31 var theme1 = new dojox.charting.Theme({
32 seriesThemes: [
33 {
34 fill: {
35 type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 100,
36 colors: [{ offset: 0, color: "white" }, { offset: 1, color: "red" }]
37 }
38 },
39 {
40 fill: {
41 type: "linear", space: "plot", x1: 0, y1: 100, x2: 100, y2: 0,
42 colors: [{ offset: 0, color: "white" }, { offset: 1, color: "blue" }]
43 }
44 },
45 {
46 fill: {
47 type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 100,
48 colors: [{ offset: 0, color: "white" }, { offset: 1, color: "green" }]
49 }
50 }
51 ]
52 });
53
54 var chart1 = new dojox.charting.Chart("c1").
55 setTheme(theme1).
56 addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.2}).
57 addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true}).
58 addPlot("default", {type: "Bars"}).
59 addSeries("Series A", [1, 2, 3, 4, 5]).
60 addSeries("Series B", [5, 4, 3, 2, 1]).
61 render();
62
63 var chart2 = new dojox.charting.Chart("c2").
64 setTheme(theme1).
65 addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}).
66 addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true}).
67 addPlot("default", {type: "StackedBars"}).
68 addSeries("Series A", [2, 3, 3, 3, 5]).
69 addSeries("Series B", [1, 4, 5, 2, 1]).
70 addSeries("Series C", [2, 1, 2, 1, 3]).
71 render();
72
73 var chart3 = new dojox.charting.Chart("c3").
74 setTheme(theme1).
75 addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}).
76 addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true}).
77 addPlot("default", {type: "ClusteredBars", gap: 5}).
78 addSeries("Series A", [2, 3, 3, 3, 5]).
79 addSeries("Series B", [1, 4, 5, 2, 1]).
80 addSeries("Series C", [2, 1, 2, 1, 3]).
81 render();
82 };
83
84 dojo.addOnLoad(run);
85 </script>
86 </head>
87 <body>
88 <p><button id="start" onclick="run();">Start!</button></p>
89 <h1>plot-space diagonal gradient</h1>
90 <p>Bars</p>
91 <div id="c1" style="position: relative; width: 600px; height: 400px;"></div>
92 <p>Stacked Bars</p>
93 <div id="c2" style="position: relative; width: 600px; height: 400px;"></div>
94 <p>Clustered Bars</p>
95 <div id="c3" style="position: relative; width: 600px; height: 400px;"></div>
96 </body>
97 </html>