Sign in to follow this  
codesquare

unable to call setDataURL

Recommended Posts

When using the follow snippet of code:

 


function updateChart(d,chart) {

 var strURL = '/support_cases_wkly_report.php?DATE=' + d;

 strURL = strURL + '&currTime=' + getTimeForURL();

 strURL = escape(strURL);

 var chartObj = getChartFromId(chart);

 chartObj.setDataURL(strURL);

}

 

where *chart* is the DCOM ID of the chart I consistently get:

 

 

 

"Error: chartObj.setDataURL is not a function"

 

 

 

I have placed the chart in a test page not inside any forms or anything that would effect the DCOM tree in theory and the result is the same. The chart is rendered via the follow snippet of code:

 

 

 


echo renderChart("/charts/MSLine.swf?ChartNoDataText=Please wait for data to be displayed.", "/support_cases_wkly_report.php", "", "supportbyproduct", 800, 400, false, false);

 

 

 

What is going on here, and more importantly how can I resolve this issue? Thanks in advance for your assistance.

 

 

 

Jason

Share this post


Link to post
Share on other sites

The last param must be true, but is false in the php/js example. I ran into the same problem. The examples from the download that involve dynamic data update via javascript are wrong. I spent all day beating my head against the wall on this one.

 

 

 

Also, be aware that your chart ID must not contain any non-alphanumeric characters as the ID will be used in javascript function calls. I had hyphens in mine and was getting errors because the javascript the library built for me was interpreting the hyphens as minus-signs and breaking everything.

Share this post


Link to post
Share on other sites

I also had the same problem and this thread solved it, thanks!

 

 

 

However, a notice: I did not have to set $registerWithJS=1 when using the evaluation copy. After getting the professional version, things stopped working and I was stumped. I'm pretty sure the only thing I did after getting my licence was replacing swf files and clearing my IE cache. I didn't even replace the FusionCharts.js file. Isn't that wierd?

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