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