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