Upgrade to ExtJS 3.2.2 - Released 06/02/2010
[extjs.git] / examples / chart / stacked-bar-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: ['year', 'comedy', 'action', 'drama', 'thriller'],
12         data: [
13                 {year: 2005, comedy: 34000000, action: 23890000, drama: 18450000, thriller: 20060000},
14                 {year: 2006, comedy: 56703000, action: 38900000, drama: 12650000, thriller: 21000000},
15                 {year: 2007, comedy: 42100000, action: 50410000, drama: 25780000, thriller: 23040000},
16                 {year: 2008, comedy: 38910000, action: 56070000, drama: 24810000, thriller: 26940000}
17               ]
18     });
19     
20     new Ext.Panel({
21         width: 600,
22         height: 400,
23         renderTo: 'container',
24         title: 'Stacked Bar Chart - Movie Takings by Genre',
25         items: {
26             xtype: 'stackedbarchart',
27             store: store,
28             yField: 'year',
29             xAxis: new Ext.chart.NumericAxis({
30                 stackingEnabled: true,
31                 labelRenderer: Ext.util.Format.usMoney
32             }),
33             series: [{
34                 xField: 'comedy',
35                 displayName: 'Comedy'
36             },{
37                 xField: 'action',
38                 displayName: 'Action'
39             },{
40                 xField: 'drama',
41                 displayName: 'Drama'
42             },{
43                 xField: 'thriller',
44                 displayName: 'Thriller'
45             }]
46         }
47     });
48 });