Debian Codegraph @

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