Sign in to follow this  
myusername

IE7 update chart

Recommended Posts

I use fusionChart in IE7 , sometimes display the wrong output from updatechart by using ajax to replace xml file

 

 

 

complete => complete display.bmp

 

 

 

wrong => error display.bmp

 

 

 

code :

function updateChart(xmlData){

if(isIE){

	var chart = new FusionCharts("/static/swf/MSArea.swf", "chart_display", "208", "180", "0", "0");

}else{

	var chart = new FusionCharts("/static/swf/MSArea.swf", "chart_display", "100%", "100%", "0", "0");

}

chart.setDataXML(xmlData);

chart.render("graph");

}

 

xmlData is xml file from ajax request

 

 

 

 

 

Please help me!, thank you.

 

 

 

[email protected]

Share this post


Link to post
Share on other sites

Hi,

If you have already renderd a chart before AJAX PostBack, why pain yourself/browser to re-load the chart again.

You can just use setDataXML() to update an existing chart.

Just you would need to render the chart once:

var chart = new FusionCharts("/static/swf/MSArea.swf", "chart_display", "208", "180", "0", "1");

 

NOTE the "1" at the end which would allow JavaScript to update chart later on.

Now,

in your update chart code simply write:

getChartFromId("chart_display").setDataXML(xmlData);

 

or if you have received the response text in URLEncoded form :

getChartFromId("chart_display").setDataXML(unesape(xmlData));

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this