Hi,
I try to add a chart to the great desktop module <br><br>I tried this but it doesn't work:
Code:
var b = new Ext.data.JsonReader({
fields: ["season","Good"],data:[
{season: "G",Good:10},
{season: "D",Good:20},
{season: "R",Good:40}
]
});
MyDesktop.ChartWindow = Ext.extend(Ext.app.Module, {
id:'chart-win',
init : function(){
this.launcher = {
text: 'Charts',
iconCls:'icon-chart',
handler : this.createWindow,
scope: this
}
},
createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('cost-win');
/***************************************** load initial cost data ******************************************/
var cost_details = new Ext.Panel({
id: "ch",
border:false,
region : 'center',
margins : '3 3 3 0',
frame:true,
item:[{xtype:"linechart",store:b,xField:"season",yField:"Good"}]
});
if(!win){
win = desktop.createWindow({
id: 'chart-win',
title:'Charts',
iconCls: 'icon-chart',
width:1100,
height:450,
border : false,
plain : true,
layout : 'border',
items:[cost_details]
});
}
win.show();
}
});
any idea how to make it works?