Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / examples / chart / pie-chart.js
1 /*!
2  * Ext JS Library 3.1.0
3  * Copyright(c) 2006-2009 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 Ext.chart.Chart.CHART_URL = '../../resources/charts.swf';\r
8 \r
9 Ext.onReady(function(){\r
10     var store = new Ext.data.JsonStore({\r
11         fields: ['season', 'total'],\r
12         data: [{\r
13             season: 'Summer',\r
14             total: 150\r
15         },{\r
16             season: 'Fall',\r
17             total: 245\r
18         },{\r
19             season: 'Winter',\r
20             total: 117\r
21         },{\r
22             season: 'Spring',\r
23             total: 184\r
24         }]\r
25     });\r
26     \r
27     new Ext.Panel({\r
28         width: 400,\r
29         height: 400,\r
30         title: 'Pie Chart with Legend - Favorite Season',\r
31         renderTo: 'container',\r
32         items: {\r
33             store: store,\r
34             xtype: 'piechart',\r
35             dataField: 'total',\r
36             categoryField: 'season',\r
37             //extra styles get applied to the chart defaults\r
38             extraStyle:\r
39             {\r
40                 legend:\r
41                 {\r
42                     display: 'bottom',\r
43                     padding: 5,\r
44                     font:\r
45                     {\r
46                         family: 'Tahoma',\r
47                         size: 13\r
48                     }\r
49                 }\r
50             }\r
51         }\r
52     });\r
53 });