Debian Codegraph @

dojox/charting/tests/BidiSupport/mirror_Pie_smart_label.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>Pie 2D: Smart Label</title>
19 <style type="text/css">
20 @import "../../../../dojo/resources/dojo.css";
21 @import "../../../../dijit/tests/css/dijitTests.css";
22 @import "../../../../dijit/themes/claro/claro.css";
23 @import "../../resources/Legend.css";
24 </style>
25 <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="parseOnLoad:true, has:{'dojo-bidi': true}">
26 </script>
27 <script type="text/javascript">
28 dojo.require("dojo.parser");
29 dojo.require("doh.runner");
30
31 dojo.require("dojox.charting.Chart");
32 dojo.require("dojox.charting.plot2d.Pie");
33 dojo.require("dojox.charting.action2d.Highlight");
34 dojo.require("dojox.charting.action2d.MoveSlice");
35 dojo.require("dojox.charting.action2d.Tooltip");
36 dojo.require("dojox.charting.themes.Tom");
37 dojo.require("dojox.charting.widget.Legend");
38
39 var pieChart = null;
40 var legend = null;
41 dojo.addOnLoad(function(){
42 var dc = dojox.charting;
43 pieChart = new dc.Chart("pieChart", {textDir:"rtl"});
44 pieChart.setTheme(dc.themes.Tom).addPlot("default", {
45 type: "Pie",
46 font: "normal normal 10pt Tahoma",
47 fontColor: "#ccc",
48 labelWiring: "#ccc",
49 radius: 100,
50 labelStyle: "columns",
51 htmlLabels: true,
52 startAngle: -10
53 }).addSeries("Series A", [{
54 y: 12.1,
55 text: "The country is \u05e1\u05d9\u05df.",
56 tooltip: "1,210 \u05de\u05dc\u05d9\u05d5\u05df."
57 },{
58 y: 9.52,
59 text: "\u05d4\u05de\u05d3\u05d9\u05e0\u05d4\u0020\u05d4\u05d9\u05d0 India.",
60 tooltip: "952 million."
61 }, {
62 y: 2.66,
63 text: "\u05d0\u05e8\u05d4\u0022\u05d1.",
64 tooltip: "266 \u05de\u05dc\u05d9\u05d5\u05df."
65 }, {
66 y: 2.06,
67 text: "Indonisia.",
68 tooltip: "206 million."
69 }, {
70 y: 1.63,
71 text: "Brazil.",
72 tooltip: "163 million."
73 },{
74 y: 1.48,
75 text: "Russian.",
76 tooltip: "148 million."
77 },{
78 y: 1.29,
79 text: "Pakistan.",
80 tooltip: "129 million."
81 },{
82 y: 1.25,
83 text: "Japan.",
84 tooltip: "125 million."
85 },{
86 y: 1.23,
87 text: "Bangladesh.",
88 tooltip: "123 million."
89 },{
90 y: 1.04,
91 text: "Nigeria.",
92 tooltip: "104 million."
93 },{
94 y: 0.96,
95 text: "Mexico.",
96 tooltip: "96 million."
97 },{
98 y: 0.84,
99 text: "Germany.",
100 tooltip: "84 million."
101 },{
102 y: 0.74,
103 text: "Phillippines.",
104 tooltip: "74 million."
105 },{
106 y: 0.74,
107 text: "Viet Nam.",
108 tooltip: "74 million."
109 },{
110 y: 0.66,
111 text: "Iran.",
112 tooltip: "66 million."
113 },{
114 y: 0.64,
115 text: "Egypt.",
116 tooltip: "64 million."
117 }]);
118 var anim_b = new dc.action2d.Highlight(pieChart, "default");
119 var anim_c = new dc.action2d.Tooltip(pieChart, "default");
120 pieChart.setDir("rtl");
121 pieChart.render();
122 legend = new dojox.charting.widget.Legend({
123 chart: pieChart,
124 horizontal:false
125 }, "legend");
126
127 doh.register("parse", function(){
128 dojo.parser.parse();
129 });
130
131 doh.register("test textDir", [
132 {
133 name: "Pies textDir",
134
135 runTest: function(){
136 doh.is("rtl", pieChart.textDir, "pieChart: internal labels");
137 doh.is("rtl", legend.textDir, "legend: external labels");
138 }
139 }
140 ]);
141
142 doh.run();
143
144 });
145 function refreshChart(){
146 var newData = [];
147 for(var i = 0; i < 16; i++){
148 newData.push(Math.random()*10);
149 }
150 newData.sort(function(v1,v2){return v2 - v1});
151 pieChart.updateSeries("Series A", newData);
152 pieChart.setDir("rtl");
153 pieChart.render();
154 legend.refresh();
155 }
156 </script>
157 </head>
158 <body class="claro">
159 <h1>Pie 2D: Smart Label</h1>
160 <p>Example of Pie chart using smart label:</p>
161 <div style="margin:20px">
162 <div id="pieChart" style="width: 470px; height: 350px; float:left;">
163 </div>
164 <div id="legend">
165 </div>
166 </div>
167 <button onclick="refreshChart()">Random Data Test</button>
168 </body>
169 </html>