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