PDA

View Full Version : Restyling Chart ind Ext.panel



DeDarling
11 Nov 2010, 7:50 AM
Hi,

i have one Linechart in an Ext.Panel.

I want a listener that changes the linechart into columnchart ...

I tried this with a listener in the tbar.


var chart = new Ext.Panel({
height: 400,
title: 'Übersicht - Ausgezählte Merkmale',
frame: true,
tbar: [{
text: 'Balken',
handler: function(){
chart.items.items[0].xtype = 'columnchart';
chart.items.items[0].refresh();
}
},
{
text: 'Punkte',
handler: function(){

}
}],
items: {
xtype: 'linechart',
store: store,
yField: 'Anzahl',
url: 'http://localhost/ext/resources/charts.swf',
xField: 'ClientID',
xAxis: new Ext.chart.CategoryAxis({
title: 'ClientID',
labelRenderer : Ext.util.Format.numberRenderer('0,0')
}),
yAxis: new Ext.chart.NumericAxis({
title: 'Anzahl',
labelRenderer : Ext.util.Format.numberRenderer('0,0')
}),
extraStyle: {
xAxis: {
labelRotation: -90
}
}
}
});

DeDarling
2 Dec 2010, 12:23 AM
Anyone an Idea ?