PDA

View Full Version : Not able to integrate fusion chart (3.1) with extjs 4



mallikarjun_sh
3 Jul 2014, 6:12 AM
function addChart(id){
//id is parent component id
Ext.getComp(id).items.add({title:'Chart 1', width:400, height:400});
var items = Ext.getCmp(id).items; //getting the above added items
var chart = new FusionCharts("Column3D", "myChartId_1", "400", "400");
var chartURL = 'rest/chart/get?chartTye=Column3D';
chart.setXMLUrl(chartURL);
chart.render(items.items[0].id);
}


I am calling the addChart from the below code snippet but its not working but if I uncomment items in the below snippet and directly reads the items in addChart then its working. Please help me asap. Do I need to use any extjs plugins. For ext 3.1 version we are using uxchart.js, uxmedia.js, uxflash.js and uxvismode.js but now we are migrating to fusion charts 3.1 and ext js 4.2.2

{
xtype:'panel',
flex: 1,
margins:'0 3 3 3',
bodyStyle : "background-color:white",
border: true,
//items:[{title:'chart 1',border:true,width:400, height:400}],


listeners:{
afterrender:function(){
addChart(this.id);
}
}
}

It will be helpful if you could share some examples.

Gary Schlosberg
13 Jul 2014, 3:23 PM
Haven't used Fusion myself, but here's a thread that might help:
http://www.sencha.com/forum/showthread.php?231221

vipul.suthar
14 Jul 2014, 6:57 PM
instead of chart.render(items.items[0].id) use chart.render(items.items[0].getEl().id);