Sign in to follow this  
Pallav

Chart rendering error using AJAX

Recommended Posts

Hi there

i'm using ajax to display a multi level pie chart in a div using ajax. Most of the time is displays fine, but occasionally it will not render out correctly, with the data seemingly rendering to the upper left corner. Does anyone know what may cause this issue?

Thanks

James

Share this post


Link to post
Share on other sites

James,

 

 

 

Can you make sure you're not specifying the chart width/height in % and using FusionCharts javascript class to embed the chart?

Share this post


Link to post
Share on other sites

Im definately using pixels. The problem is only when i use ajax.

When using ajax i DONT use the javascript method, just the straight embed method. Any ideas? I tried to put a javascript settimeout to give the chart data time set up, but to no avail :(

Share this post


Link to post
Share on other sites

hi,

AJAX Posrtback responses are received and procesessed by a JavaScript method. Mostly if it gets responseText or responseXML as HTML it sets it to some DIV or other HTML object's innerHTML and the HTML gets updated. Now, this javaScript method that sets the innerHTML with the HTML received in AJAX posback response will also set any JavaScript revceived in the postback response, but...BUT the Browser WONT evaluate/run the script. Hence it wont work.

I can think of a work around. Here we need to make a javaScript method which will

1 .examine the entire responseText and collect the javascript parts separately in a string,

2. do the regular HTML updatess setting innerHTML etc. and

3. Finally run/eval the collected JavaScript using eval(theString); method.

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