]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojox/charting/tests/test_pie2d.html
Comment class stub
[eow] / static / dojo-release-1.1.1 / dojox / charting / tests / test_pie2d.html
1 <html>
2 <head>
3 <title>Pie 2D</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <style type="text/css">
6         @import "../../../dojo/resources/dojo.css";
7         @import "../../../dijit/tests/css/dijitTests.css";
8 </style>
9 <!--
10 The next line should include Microsoft's Silverligth.js, if you plan to use the silverlight backend
11 <script type="text/javascript" src="Silverlight.js"></script>
12 -->
13 <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
14 <script type="text/javascript" src="../../lang/functional.js"></script>
15 <script type="text/javascript" src="../../lang/functional/fold.js"></script>
16 <script type="text/javascript" src="../../lang/utils.js"></script>
17 <script type="text/javascript" src="../Theme.js"></script>
18 <script type="text/javascript" src="../scaler.js"></script>
19 <script type="text/javascript" src="../Element.js"></script>
20 <script type="text/javascript" src="../plot2d/Pie.js"></script>
21 <script type="text/javascript" src="../Chart2D.js"></script>
22 <script type="text/javascript">
23
24 dojo.require("dojox.charting.Chart2D");
25 dojo.require("dojox.charting.themes.PlotKit.blue");
26 dojo.require("dojox.charting.themes.PlotKit.green");
27 dojo.require("dojox.charting.themes.PlotKit.red");
28
29 makeObjects = function(){
30         var chart1 = new dojox.charting.Chart2D("test1");
31         chart1.setTheme(dojox.charting.themes.PlotKit.blue);
32         chart1.addPlot("default", {
33                 type: "Pie", 
34                 font: "normal normal bold 12pt Tahoma", 
35                 fontColor: "white", 
36                 labelOffset: 40
37         });
38         chart1.addSeries("Series A", [4, 2, 1, 1]);
39         chart1.render();
40
41         var chart2 = new dojox.charting.Chart2D("test2");
42         chart2.setTheme(dojox.charting.themes.PlotKit.blue);
43         chart2.addPlot("default", {
44                 type: "Pie", 
45                 font: "normal normal bold 12pt Tahoma", 
46                 fontColor: "black", 
47                 labelOffset: -25,
48                 precision: 0
49         });
50         chart2.addSeries("Series A", [4, 2, 1, 1]);
51         chart2.render();
52
53         var chart3 = new dojox.charting.Chart2D("test3");
54         chart3.setTheme(dojox.charting.themes.PlotKit.green);
55         chart3.addPlot("default", {
56                 type: "Pie", 
57                 font: "normal normal bold 10pt Tahoma", 
58                 fontColor: "white", 
59                 labelOffset: 25, 
60                 radius: 90
61         });
62         chart3.addSeries("Series A", [4, 2, 1, 1]);
63         chart3.render();
64
65         var chart4 = new dojox.charting.Chart2D("test4");
66         chart4.setTheme(dojox.charting.themes.PlotKit.green);
67         chart4.addPlot("default", {
68                 type: "Pie", 
69                 font: "normal normal bold 10pt Tahoma", 
70                 fontColor: "black", 
71                 labelOffset: -25, 
72                 radius: 90
73         });
74         chart4.addSeries("Series A", [4, 2, 1, 1]);
75         chart4.render();
76
77         var chart5 = new dojox.charting.Chart2D("test5");
78         chart5.setTheme(dojox.charting.themes.PlotKit.red);
79         chart5.addPlot("default", {
80                 type: "Pie", 
81                 font: "normal normal bold 14pt Tahoma", 
82                 fontColor: "white", 
83                 labelOffset: 40
84         });
85         chart5.addSeries("Series A", [{y: 4, text: "Red"}, {y: 2, text: "Green"}, {y: 1, text: "Blue"}, {y: 1, text: "Other"}]);
86         chart5.render();
87
88         var chart6 = new dojox.charting.Chart2D("test6");
89         chart6.setTheme(dojox.charting.themes.PlotKit.red);
90         chart6.addPlot("default", {
91                 type: "Pie", 
92                 font: "normal normal bold 14pt Tahoma", 
93                 fontColor: "white", 
94                 labelOffset: 40
95         });
96         chart6.addSeries("Series A", [
97                 {y: 4, text: "Red", color: "red"},
98                 {y: 2, text: "Green", color: "green"},
99                 {y: 1, text: "Blue", color: "blue"},
100                 {y: 1, text: "Other", color: "white", fontColor: "black"}
101         ]);
102         chart6.render();
103 };
104
105 dojo.addOnLoad(makeObjects);
106
107 </script>
108 </head>
109 <body>
110 <h1>Pie 2D</h1>
111 <!--<p><button onclick="makeObjects();">Go</button></p>-->
112 <p>1: Pie with internal labels.</p>
113 <div id="test1" style="width: 300px; height: 300px;"></div>
114 <p>2: Pie with external labels and precision=0.</p>
115 <div id="test2" style="width: 300px; height: 300px;"></div>
116 <p>3/4: Two pies with internal and external labels with a constant radius.</p>
117 <table border="1"><tr>
118         <td><div id="test3" style="width: 300px; height: 300px;"></div></td>
119         <td><div id="test4" style="width: 300px; height: 300px;"></div></td>
120 </tr></table>
121 <p>5/6: Pie with internal custom labels and custom colors.</p>
122 <table border="1"><tr>
123         <td><div id="test5" style="width: 300px; height: 300px;"></div></td>
124         <td><div id="test6" style="width: 300px; height: 300px;"></div></td>
125 </tr></table>
126 <p>That's all Folks!</p>
127 </body>
128 </html>