Debian Codegraph @

dojox/charting/tests/test_labels2d.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 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
18 <title>Chart 2D labels</title>
19 <style type="text/css">
20 @import "../../../dojo/resources/dojo.css";
21 @import "../../../dijit/tests/css/dijitTests.css";
22 </style>
23 <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script>
24 <script type="text/javascript">
25
26 dojo.require("dojox.charting.Chart");
27 dojo.require("dojox.charting.axis2d.Default");
28 dojo.require("dojox.charting.plot2d.Bars");
29
30 makeObjects = function(){
31 var chart1 = new dojox.charting.Chart("test1");
32 chart1.addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true});
33 chart1.addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true});
34 chart1.addPlot("default", {type: "Bars"});
35 chart1.addSeries("Series A", [1, 2, 3, 4, 5], {stroke: {color: "red"}, fill: "lightpink"});
36 chart1.addSeries("Series B", [5, 4, 3, 2, 1], {stroke: {color: "blue"}, fill: "lightblue"});
37 chart1.render();
38
39 var chart2 = new dojox.charting.Chart("test2");
40 chart2.addAxis("x", {
41 fixLower: "major", fixUpper: "major", includeZero: true,
42 labels: [
43 //{value: 0, text: "zero"},
44 {value: 2, text: "two"},
45 {value: 4, text: "four"}
46 ]
47 });
48 chart2.addAxis("y", {
49 vertical: true, fixLower: "major", fixUpper: "major", natural: true,
50 labels: [{value: 0, text: ""},
51 {value: 1, text: "Jan"}, {value: 2, text: "Feb"},
52 {value: 3, text: "Mar"}, {value: 4, text: "Apr"},
53 {value: 5, text: "May"}, {value: 6, text: "Jun"}]
54 });
55 chart2.addPlot("default", {type: "Bars"});
56 chart2.addSeries("Series A", [1, 2, 3, 4, 5], {stroke: {color: "red"}, fill: "lightpink"});
57 chart2.addSeries("Series B", [5, 4, 3, 2, 1], {stroke: {color: "blue"}, fill: "lightblue"});
58 chart2.render();
59
60
61 var chart3 = new dojox.charting.Chart("test3");
62 chart3.addAxis("x", {
63 fixLower: "major", fixUpper: "major", includeZero: true,
64 labels: [{value: 0, text: "z e r o"}, {value: 2, text: "t w o"}, {value: 4, text: "f o u r"}]
65 });
66 chart3.addAxis("y", {
67 vertical: true, fixLower: "major", fixUpper: "major", natural: true,
68 labels: [{value: 0, text: ""},
69 {value: 1, text: "J A N"}, {value: 2, text: "F E B"},
70 {value: 3, text: "M A R"}, {value: 4, text: "A P R"},
71 {value: 5, text: "M A Y"}, {value: 6, text: "J U N"}]
72 });
73 chart3.addPlot("default", {type: "Bars"});
74 chart3.addSeries("Series A", [1, 2, 3, 4, 5], {stroke: {color: "red"}, fill: "lightpink"});
75 chart3.addSeries("Series B", [5, 4, 3, 2, 1], {stroke: {color: "blue"}, fill: "lightblue"});
76 chart3.render();
77
78 var chart4 = new dojox.charting.Chart("test4");
79 chart4.addAxis("x", {
80 majorLabels: false,
81 includeZero: true,
82 minorTicks: false,
83 microTicks: false,
84 majorTick: { length: 0 }
85 });
86 chart4.addAxis("y", {
87 vertical: true,
88 fixLower: "none",
89 fixUpper: "none",
90 natural: true,
91 majorTick: { length: 3 },
92 labels: [
93 {value: 0, text: ""},
94 {value: 1, text: "January"},
95 {value: 2, text: "Febuary"},
96 {value: 3, text: "March"},
97 {value: 4, text: "April"},
98 {value: 5, text: "May"}
99 ]
100 });
101 chart4.addPlot("default", { type: "Bars", gap: 3 });
102 chart4.addSeries(
103 "Series A",
104 [ 1, 6, 9, 4, 5, 2 ],
105 {
106 stroke: {width: 0},
107 // fill: "#ffcc2d",
108 fill: {
109 type: "linear",
110 x1: 0, y1: 0,
111 x2: 150, y2: 0,
112 colors: [
113 { offset: 0, color: "#ffe495" },
114 { offset: 1, color: "#ffcc2d" }
115 ]
116 }
117 }
118 );
119 chart4.render();
120
121 var chart5 = new dojox.charting.Chart("test5").
122 addAxis("x", {
123 fixLower: "major", fixUpper: "major", includeZero: true,
124 labels: [
125 {value: 0, text: "zero"},
126 {value: 2, text: "two"},
127 {value: 4, text: "four"}
128 ],
129 rotation: 30
130 }).
131 addAxis("y", {
132 vertical: true, fixLower: "major", fixUpper: "major", natural: true,
133 labels: [{value: 0, text: ""},
134 {value: 1, text: "January"}, {value: 2, text: "February"},
135 {value: 3, text: "March"}, {value: 4, text: "April"},
136 {value: 5, text: "May"}, {value: 6, text: "June"}
137 ],
138 rotation: -30
139 }).
140 addPlot("default", {type: "Bars"}).
141 addSeries("Series A", [1, 2, 3, 4, 5], {stroke: {color: "red"}, fill: "lightpink"}).
142 addSeries("Series B", [5, 4, 3, 2, 1], {stroke: {color: "blue"}, fill: "lightblue"}).
143 render();
144
145 var chart6 = new dojox.charting.Chart("test6").
146 addAxis("x", {
147 fixLower: "major", fixUpper: "major", includeZero: true,
148 labels: [
149 {value: 0, text: "zero"},
150 {value: 2, text: "two"},
151 {value: 4, text: "four"}
152 ],
153 rotation: 180
154 }).
155 addAxis("y", {
156 vertical: true, fixLower: "major", fixUpper: "major", natural: true, majorTickStep: 2,
157 labels: [{value: 0, text: ""},
158 {value: 1, text: "January"}, {value: 2, text: "February"},
159 {value: 3, text: "March"}, {value: 4, text: "April"},
160 {value: 5, text: "May"}, {value: 6, text: "June"}
161 ],
162 rotation: 90
163 }).
164 addPlot("default", {type: "Bars"}).
165 addSeries("Series A", [1, 2, 3, 4, 5], {stroke: {color: "red"}, fill: "lightpink"}).
166 addSeries("Series B", [5, 4, 3, 2, 1], {stroke: {color: "blue"}, fill: "lightblue"}).
167 render();
168 };
169
170 dojo.addOnLoad(makeObjects);
171
172 </script>
173 </head>
174 <body>
175 <h1>Chart 2D labels</h1>
176 <!--<p><button onclick="makeObjects();">Go</button></p>-->
177 <p>1: Bars, axes aligned on major ticks, no minor ticks, custom strokes and fills.</p>
178 <div id="test1" style="width: 200px; height: 200px;"></div>
179 <p>2: Bars, axes aligned on major ticks, no minor ticks, custom strokes and fills, custom labels.</p>
180 <div id="test2" style="width: 200px; height: 200px;"></div>
181 <p>3: Bars, axes aligned on major ticks, no minor ticks, custom strokes and fills, custom labels with spaces.</p>
182 <div id="test3" style="width: 200px; height: 200px;"></div>
183 <p>4: Trying to make it look good.</p>
184 <div id="test4" style="width: 200px; height: 200px;"></div>
185 <p>5: Label rotation.</p>
186 <div id="test5" style="width: 200px; height: 200px;"></div>
187 <p>6: Label rotation (opposite).</p>
188 <div id="test6" style="width: 200px; height: 200px;"></div>
189 <p>That's all Folks!</p>
190 </body>
191 </html>