1 Ext.define('Ext.app.ChartPortlet', {
3 extend: 'Ext.panel.Panel',
4 alias: 'widget.chartportlet',
8 'Ext.chart.theme.Base',
9 'Ext.chart.series.Series',
10 'Ext.chart.series.Line',
11 'Ext.chart.axis.Numeric'
14 generateData: function(){
21 for (i = 1; i < 50; i++) {
24 sp500: data[i - 1].sp500 + ((Math.floor(Math.random() * 2) % 2) ? -1 : 1) * Math.floor(Math.random() * 7),
25 djia: data[i - 1].djia + ((Math.floor(Math.random() * 2) % 2) ? -1 : 1) * Math.floor(Math.random() * 7)
31 initComponent: function(){
41 store: Ext.create('Ext.data.JsonStore', {
42 fields: ['name', 'sp500', 'djia'],
43 data: this.generateData()
52 title: 'Dow Jones Average',
91 this.callParent(arguments);