1 Ext.require('Ext.chart.*');
2 Ext.require('Ext.layout.container.Fit');
4 Ext.onReady(function () {
5 var store = Ext.create('Ext.data.JsonStore', {
6 fields: ['year', 'comedy', 'action', 'drama', 'thriller'],
8 {year: 2005, comedy: 34000000, action: 23890000, drama: 18450000, thriller: 20060000},
9 {year: 2006, comedy: 56703000, action: 38900000, drama: 12650000, thriller: 21000000},
10 {year: 2007, comedy: 42100000, action: 50410000, drama: 25780000, thriller: 23040000},
11 {year: 2008, comedy: 38910000, action: 56070000, drama: 24810000, thriller: 26940000}
15 var panel1 = Ext.create('widget.panel', {
18 title: 'Stacked Bar Chart - Movies by Genre',
19 renderTo: Ext.getBody(),
32 fields: ['comedy', 'action', 'drama', 'thriller'],
36 renderer: function(v) {
37 return String(v).replace(/000000$/, 'M');
52 yField: ['comedy', 'action', 'drama', 'thriller'],
58 renderer: function(storeItem, item) {
59 this.setTitle(String(item.value[1] / 1000000) + 'M');