Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / pie-chart.html
1 <html>\r
2 <head>\r
3   <title>The source code</title>\r
4     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
5     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
6 </head>\r
7 <body  onload="prettyPrint();">\r
8     <pre class="prettyprint lang-js">Ext.chart.Chart.CHART_URL = '../../resources/charts.swf';\r
9 \r
10 Ext.onReady(function(){\r
11     var store = new Ext.data.JsonStore({\r
12         fields: ['season', 'total'],\r
13         data: [{\r
14             season: 'Summer',\r
15             total: 150\r
16         },{\r
17             season: 'Fall',\r
18             total: 245\r
19         },{\r
20             season: 'Winter',\r
21             total: 117\r
22         },{\r
23             season: 'Spring',\r
24             total: 184\r
25         }]\r
26     });\r
27     \r
28     new Ext.Panel({\r
29         width: 400,\r
30         height: 400,\r
31         title: 'Pie Chart with Legend - Favorite Season',\r
32         renderTo: 'container',\r
33         items: {\r
34             store: store,\r
35             xtype: 'piechart',\r
36             dataField: 'total',\r
37             categoryField: 'season',\r
38             //extra styles get applied to the chart defaults\r
39             extraStyle:\r
40             {\r
41                 legend:\r
42                 {\r
43                     display: 'bottom',\r
44                     padding: 5,\r
45                     font:\r
46                     {\r
47                         family: 'Tahoma',\r
48                         size: 13\r
49                     }\r
50                 }\r
51             }\r
52         }\r
53     });\r
54 });</pre>    \r
55 </body>\r
56 </html>