Can't get Chart Object
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Can't get Chart Object Expand / Collapse
Author
Message
Posted 3/5/2008 9:24:54 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/6/2008 1:24:22 AM
Posts: 1, Visits: 5
I have an interesting puzzle. This works perfectly in a standard HTML page, but I can't seem to get it working in ExtJS.

Here is what I do in the HTML:
1) Draw a chart (with Fusion) in a DIV tag.
2) Reference the DIV tag in javascript to call setDataURL. This updates the chart data without a full page reload

So, In Extjs:
1) Draw the chart in the HTML div
2) Load the DIV into a Panel using contentEl
3) call setDataURL on the chart DIV from a handler function.
4) **** ERROR! I get an error that chart DIV doesn't exist. This is weird, because Firebug show it in the DOM inspector

Can someone help me sort this one out.

The Javascript is:

var chart1 = new FusionCharts("Charts/ScrollLine2D.swf", "chartHistory", "900", "400", "0", "1");

function updateHandler1(){
var nf = Ext.get('g1feed').getValue();
var st = Ext.get('g1term').getValue();
var dt = Ext.get('g1date').getValue();
var newurl = '/v7/chartxml.php?'+ 'nf=' + nf + '&st='+ st + '&dt=' + dt;
Ext.Msg.alert('New URL is', newurl);
var chartObj = getChartFromId(chartHistory);
chartObj.setDataURL(newurl);
}

Post #4950
Posted 3/5/2008 11:52:36 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 6:58:37 AM
Posts: 632, Visits: 1,928
hi,
I went through your problem. Please try the solution stated below :


var newurl = '/v7/chartxml.php?'+ 'nf=' + nf + '&st='+ st + '&dt=' + dt;

// please add this line for url encode
newurl = escape(newurl );

// chartHistory must be with in quotes
var chartObj = getChartFromId("chartHistory");

i think it will solve your problem

Arindam


Thanks,
Arindam

FusionCharts Team
www.fusioncharts.com

Post #4951
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 7:04pm


Execution: 0.109.