PDA

View Full Version : this.swf is undefined while creating bar chart and piechart



varunjyoti
15 Feb 2012, 11:08 PM
Hi,


{
xtype:'piechart',
store:'result_overview_store',
id:'dfr-results-graph1',
height:200,
width:200,
dataField: 'count',
categoryField: 'sensitivetype',

},
{
xtype:'barchart',
height:200,
width:300,
store:'result_overview_store',
id:'dfr-results-graph2',
xField:'count',
yField:'sensitivetype',

}

I am using same data for both the charts. The piechart displays fine but bar chart is not displayed properly. just x-axis and y-axis is displyaed for it. I also get an error this.swf is undefined on line this.swf.setDataProvider(dataProvider);

Please let me know what am i doing wrong.

mitchellsimoens
16 Feb 2012, 4:46 AM
You can try setting the url config on the chart to the charts.swf file.

willigogs
16 Feb 2012, 6:34 AM
Try adding the following to your chart configs:


listeners: {
beforerefresh: function(chart) {
return Ext.isDefined(chart.swf.setDataProvider);
}
}