Debian Codegraph @

dojox/charting/tests/BidiSupport/mirror_SetTextDir.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>Chart2D Title</title>
19 <style type="text/css">
20 @import "../../../../dojo/resources/dojo.css";
21 @import "../../../../dijit/tests/css/dijitTests.css";
22 @import "../../../../dijit/themes/tundra/tundra.css";
23 @import "../../resources/Legend.css";
24
25
26 .axisTitleRotation90 {
27 transform: rotate(90deg);
28 -o-transform: rotate(90deg);
29 -webkit-transform: rotate(90deg);
30 -moz-transform: rotate(90deg);
31 }
32 .axisTitleRotation180 {
33 transform: rotate(180deg);
34 -o-transform: rotate(180deg);
35 -webkit-transform: rotate(180deg);
36 -moz-transform: rotate(180deg);
37 }
38 .axisTitleRotation270 {
39 transform: rotate(-90deg);
40 -o-transform: rotate(-90deg);
41 -webkit-transform: rotate(-90deg);
42 -moz-transform: rotate(-90deg);
43 }
44 .pie {
45 width:500px;
46 height:500px;
47 }
48
49 </style>
50 <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true, has:{'dojo-bidi': true}"></script>
51 <script type="text/javascript">
52 dojo.require("dojo.parser");
53 dojo.require("doh.runner");
54
55 dojo.require("dojox.charting.Chart");
56 dojo.require("dojox.charting.axis2d.Default");
57 dojo.require("dojox.charting.plot2d.Lines");
58 dojo.require("dojox.charting.plot2d.Columns");
59 dojo.require("dojox.charting.themes.PlotKit.orange");
60 dojo.require("dojox.charting.action2d.Shake");
61 dojo.require("dojox.charting.action2d.Tooltip");
62 dojo.require("dojox.charting.widget.SelectableLegend");
63
64 dojo.require("dijit.dijit");
65 dojo.require("dojox.charting.widget.Chart");
66 dojo.require("dojox.charting.plot2d.Grid");
67 dojo.require("dojox.data.HtmlStore");
68 dojo.require("dojox.charting.plot2d.Areas");
69 dojo.require("dojox.charting.widget.Legend");
70
71 dojo.require("dojox.charting.plot2d.Pie");
72 dojo.require("dojox.charting.themes.MiamiNice");
73 dojo.require("dojox.charting.action2d.Highlight");
74
75
76 dojo.require("dijit.form.NumberSpinner");
77 dojo.require("dojo.parser");
78
79 var chart1, legend1, pie, pieLegend;
80 seriesB = [2.6, 1.8, 2, 1, 1.4, 0.7, 2];
81
82 updateAxis = function(){
83 var gap = 25,
84 rotation = 0,
85 orientation = "away";
86 chart1.addAxis("x", {
87 title: "Quarter \u05dc\u05e9\u05e0\u05ea 2010.",
88 titleGap: gap,
89 titleFontColor: "orange",
90 titleOrientation: orientation,
91 rotation: rotation,
92 includeZero: true, natural: true, fixLower: "major", fixUpper: "major",
93 labels: [
94 {value: 0, text: ""},{value: 1, text: "1 Qtr."},{value: 2, text: "2 Qtr."},
95 {value: 3, text: "3 Qtr."},{value: 4, text: "\u05e8\u05d1\u05e2\u05d5\u05df 4."},{value: 5, text: "End."}
96 ]
97 }).
98 addAxis("y", {
99 title: "\u05ea\u05e9\u05d5\u05d0\u05d4 \u0028\u05d1\u05de\u05dc\u05d9\u05d5\u05e0\u05d9\u05dd\u0029.",
100 titleGap: gap,
101 titleFontColor: "orange",
102 titleOrientation: orientation,
103 rotation: rotation,
104 vertical: true, includeZero: true, natural: true, fixLower: "major", fixUpper: "major", majorTickStep: 2,
105 labels: [
106 {value: 0, text: ""},{value: 1, text: "One."},{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."},
107 {value: 3, text: "My name: \u05d8\u05dc."},{value: 4, text: "\u05e7\u05d5\u05e8\u05d0\u05d9\u05dd\u0020\u05dc\u05d9: Tal."},{value: 5, text: "Five."},{value: 6, text: "Six."}
108 ]
109 }).
110 addAxis("x2", {
111 title: "\u05e8\u05d1\u05e2\u05d5\u05df of 2010.",
112 titleGap: gap,
113 titleFontColor: "blue",
114 titleOrientation: orientation,
115 rotation: rotation,
116 leftBottom: false,
117 includeZero: true, natural: true, fixLower: "major", fixUpper: "major"
118 }).
119 addAxis("y2", {
120 title: "Quantity(ton).",
121 titleGap: gap,
122 titleFontColor: "blue",
123 titleOrientation: orientation,
124 rotation: rotation,
125 leftBottom: false,
126 vertical: true, includeZero: true, natural: true, fixLower: "major", fixUpper: "major", majorTickStep: 2
127 });
128 var anim6b = new dojox.charting.action2d.Shake(chart1, "default2");
129 var anim6c = new dojox.charting.action2d.Tooltip(chart1, "default2");
130 chart1.setDir("rtl");
131 chart1.render();
132 legend1 = new dojox.charting.widget.SelectableLegend({chart: chart1}, "legend1");
133
134
135 };
136
137 makeObjects = function(){
138 chart1 = new dojox.charting.Chart("test1",{textDir:"auto",title:"\u05d0\u05e0\u05d9\u0020\u05db\u05d5\u05ea\u05e8\u05ea of the chart."
139 , titleFontColor: "blue"}).
140 addPlot("default", {type: "Lines"}).
141 addSeries("\u05e1\u05d3\u05e8\u05d4\u0020\u05d0\u0027.", [3, 5, 3, 4, 2], {stroke: {color: "orange"}, fill: "yellow"}).//[{x:3}, {x:5}, {x:3}, {x:4}, {x:2}], {stroke: {color: "orange"}, fill: "yellow"}).
142 addPlot("default2", {type: "Columns", gap: 15, hAxis: "x2", vAxis: "y2"}).
143 addSeries("Series B.", [{y:12,tooltip:"I'm working at \u05d9\u05d1\u05de in Israel."}, {y:8,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1- IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}, {y:15,tooltip:"I'm working at \u05d9\u05d1\u05de in Israel."}, {y:20,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1- IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}], {plot: "default2", stroke: {color: "blue"}, fill: "lightblue"});
144 updateAxis();
145 pie = new dojox.charting.Chart("pie",{textDir:"rtl"}).
146 setTheme(dojox.charting.themes.MiamiNice).
147 addPlot("default",{type:"Pie",radius:100,font: "normal normal 10pt Tahoma",htmlLabels:true,labelOffset:-20}).
148 addSeries("\u05d0\u05e3\u002e",[{
149 y: 12.1,
150 text: "\u05e1\u05d9\u05df\u002e"
151 },{
152 y: 9.52,
153 text: "India."
154 }, {
155 y: 2.66,
156 text: "USA."
157 }, {
158 y: 2.06,
159 text: "Indonesia."
160 }, {
161 y: 1.63,
162 text: "Brazil."
163 },{
164 y: 1.48,
165 text: "Russian."
166 },{
167 y: 1.29,
168 text: "Pakistan."
169 },{
170 y: 1.25,
171 text: "Japan."
172 }]).
173 setDir("rtl").
174 render();
175 var ainm = new dojox.charting.action2d.Highlight(pie,"default");
176 pieLegend = new dojox.charting.widget.SelectableLegend({chart: pie,horizontal:false, outline: true},"pieLegend");
177 };
178
179 dojo.addOnLoad(function(){
180 makeObjects();
181
182 var buttonRtl
183 , buttonLtr
184 , buttonAuto
185 , chart5
186 , legend5;
187
188 doh.register("test dynamic change of textDir.", [
189 {
190 name: "initial textDir of the chart",
191
192 setUp: function(){
193 buttonRtl = dojo.byId("buttonRtl");
194 buttonLtr = dojo.byId("buttonLtr");
195 buttonAuto = dojo.byId("buttonAuto");
196 chart5 = dijit.byId('chart5');
197 legend5 = dijit.byId('legend5');
198 },
199
200 runTest: function(){
201 doh.is("auto", chart1.textDir, "textDir of : chart1");
202 doh.is("auto", chart1.surface.textDir, "textDir of : chart1.surface");
203 doh.is("auto", legend1.textDir, "textDir of : legend1");
204
205 doh.is("rtl", pie.textDir, "textDir of : pie");
206 doh.is("rtl", pie.surface.textDir, "textDir of : pie.surface");
207 doh.is("rtl", pieLegend.textDir, "textDir of : pieLegend");
208
209 doh.is("ltr", chart5.textDir, "textDir of : chart5");
210 doh.is("ltr", chart5.chart.textDir, "textDir of : chart5");
211 doh.is("ltr", chart5.chart.surface.textDir, "textDir of : chart5.surface");
212 doh.is("ltr", legend5.textDir, "textDir of : legend5");
213
214 }
215 },
216 {
217 name: "set textDir to RTL.",
218
219 runTest: function(){
220 buttonRtl.click();
221 doh.is("rtl", chart1.textDir, "textDir of : chart");
222 doh.is("rtl", chart1.surface.textDir, "textDir of : chart");
223 doh.is("rtl", legend1.textDir, "textDir of : legend1");
224
225 doh.is("rtl", pie.textDir, "textDir of : pie");
226 doh.is("rtl", pie.surface.textDir, "textDir of : pie.surface");
227 doh.is("rtl", pieLegend.textDir, "textDir of : pieLegend");
228
229 doh.is("rtl", chart5.textDir, "textDir of : chart5");
230 doh.is("rtl", chart5.chart.textDir, "textDir of : chart5");
231 doh.is("rtl", chart5.chart.surface.textDir, "textDir of : chart5.surface");
232 doh.is("rtl", legend5.textDir, "textDir of : legend5");
233
234 }
235 },
236 {
237 name: "set textDir to LTR.",
238
239 runTest: function(){
240 buttonLtr.click();
241 doh.is("ltr", chart1.textDir, "textDir of : chart");
242 doh.is("ltr", chart1.surface.textDir, "textDir of : chart");
243 doh.is("ltr", legend1.textDir, "textDir of : legend1");
244
245 doh.is("ltr", pie.textDir, "textDir of : pie");
246 doh.is("ltr", pie.surface.textDir, "textDir of : pie.surface");
247 doh.is("ltr", pieLegend.textDir, "textDir of : pieLegend");
248
249 doh.is("ltr", chart5.textDir, "textDir of : chart5");
250 doh.is("ltr", chart5.chart.textDir, "textDir of : chart5");
251 doh.is("ltr", chart5.chart.surface.textDir, "textDir of : chart5.surface");
252 doh.is("ltr", legend5.textDir, "textDir of : legend5");
253 }
254 },
255 {
256 name: "set textDir to AUTO.",
257
258 runTest: function(){
259 buttonAuto.click();
260 doh.is("auto", chart1.textDir, "textDir of : chart");
261 doh.is("auto", chart1.surface.textDir, "textDir of : chart");
262 doh.is("auto", legend1.textDir, "textDir of : legend1");
263
264 doh.is("auto", pie.textDir, "textDir of : pie");
265 doh.is("auto", pie.surface.textDir, "textDir of : pie.surface");
266 doh.is("auto", pieLegend.textDir, "textDir of : pieLegend");
267
268 doh.is("auto", chart5.textDir, "textDir of : chart5");
269 doh.is("auto", chart5.chart.textDir, "textDir of : chart5");
270 doh.is("auto", chart5.chart.surface.textDir, "textDir of : chart5.surface");
271 doh.is("auto", legend5.textDir, "textDir of : legend5");
272 }
273 }
274
275 ]);
276 doh.run();
277 });
278 </script>
279 </head>
280 <body class="tundra">
281 <h1>Chart2D Titles</h1>
282 <p>Column chart with axis title</p>
283 <p>
284 <input id="buttonRtl"
285 onClick="
286 chart1.setTextDir('rtl');
287 dijit.byId('chart5').set('textDir','rtl');
288 pie.setTextDir('rtl');
289 "
290 type="button" value="RTL"/>
291 <input id="buttonLtr"
292 onClick="
293 chart1.setTextDir('ltr');
294 dijit.byId('chart5').set('textDir','ltr');
295 pie.setTextDir('ltr');
296 "
297 type="button" value="LTR"/>
298 <input id="buttonAuto"
299 onClick="
300 chart1.setTextDir('auto');
301 dijit.byId('chart5').set('textDir','auto');
302 pie.setTextDir('auto');
303 "
304 type="button" value="AUTO"/>
305
306 &nbsp;&nbsp;
307
308 <h2>Programmatically created chart.</h2>
309 <div id="legend1"></div>
310 <p/>
311 <div id="test1" style="width: 600px; height: 400px;"></div>
312 &nbsp;&nbsp;
313
314 <h2>HTML declared chart.</h2>
315 <div dojoType="dojox.data.HtmlStore" dataId="tableExample" data-dojo-id="tableStore"></div>
316 <table id="tableExample" style="display: none;">
317 <thead>
318 <tr><th>value</th></tr>
319 </thead>
320 <tbody>
321 <tr><td >6.3</td></tr>
322 <tr><td>1.8</td></tr>
323 <tr><td>3 </td></tr>
324 <tr><td>0.5</td></tr>
325 <tr><td>4.4</td></tr>
326 <tr><td>2.7</td></tr>
327 <tr><td>2 </td></tr>
328 </tbody>
329 </table>
330 <table border="0" cellspacing="30">
331 <tr>
332 <td>
333 <div dojoType="dojox.charting.widget.Chart" id="chart5" textDir="ltr" style="width: 600px; height: 400px;" direction="rtl">
334 <div class="axis" name="x" maxLabelCharCount= 2 title="&#1511;&#1493;&#1512;&#1488;&#1497;&#1501; &#1500;&#1497; &#1510;&#1497;&#1512; X." titleOrientation= "away" font="italic normal normal 8pt Tahoma" labels="[{value:1, text:'First.'},{value:2, text:'&#1513;&#1514;&#1497;&#1497;&#1501; &#1513;&#1500;&#1493;&#1513;.'},{value:4, text:'444444444444&#1513;.'}]"></div>
335 <div class="axis" name="y" maxLabelCharCount= 2 title="&#1511;&#1493;&#1512;&#1488;&#1497;&#1501; &#1500;&#1497; &#1510;&#1497;&#1512; Y." vertical="true" fixUpper="major" includeZero="true" labels="[{value:2, text:'&#1513;&#1514;&#1497;&#1497;&#1501; &#1513;&#1500;&#1493;&#1513;.'},{value:3, text:'Third.'},{value:4, text:'444444444444&#1513;.'}]"
336 font="italic normal normal 8pt Tahoma"></div>
337 <div class="plot" name="default" type="Areas"></div>
338 <div class="plot" name="grid" type="Grid"></div>
339 <div class="series" name="&#1505;&#1491;&#1512;&#1492; 1." data="1, 2, 0.5, 1.5, 1, 2.8, 0.4"></div>
340 <div class="series" name="Run B." array="seriesB" ></div>
341 <div class="series" name="Run C." store="tableStore" valueFn="Number(x)"></div>
342 </div>
343 <div id="legend5" dojoType="dojox.charting.widget.Legend" chartRef="chart5"></div>
344 </td>
345 </tr>
346 </table>
347 <h2>3.Pie</h2>
348 <div id="pie" class="pie" style="float:left;"></div>
349 <div style="float:left;">
350 <div id="pieLegend"></div>
351
352 </body>
353 </html>