Sign in to follow this  
lmattox

Xml Feed Problems

Recommended Posts

I have an XML feed that I am trying to show in a Fusion Chart, and I am having problems getting it to show. It works great if I save the feed, then send the chart that URL, but when I send it the feed URL, I get "Error in loading data"

 

The feed URL is:

http://www.mysource....ications&pid=32

 

This is the code I am using:

 

 

<script type="text/javascript">

var chart = new FusionCharts("http://www.mysource.coop/FusionCharts/MSCombi3D.swf", "ChartId", "400", "300", "0", "0");

chart.setDataURL("http://www.mysource.coop/DesktopModules/XModPro/Feed.aspx?xfd=CD_Communications&pid=32");

chart.render("chartdiv");

</script>

 

I am thinking I need to use something other than "setDataURL", but I'm not sure what else to use.

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

Welcome to FusionCharts Forum! smile.gif

 

If you get a "Error in Loading Data" message in your chart, it means that FusionCharts could not find XML data at the specified URL. In that case,please check the following:

 

1. Check if you've actually provided dataURL or dataXML. If you do not provide either, FusionCharts looks for a default Data.xml file in the same path. Now, if that is also not found, it shows the "Error in Loading Data" error.

 

2. If you're using dataURL method, paste this URL in your browser to check if it's returning a valid XML. Make sure, there are no scripting or time-out errors and a valid XML is being returned. Also make sure that the XML isn't intermingled with HTML content. The data provider page should return a clean XML only - not even HTML <head> or <body> tags.

 

3. Make sure you're passing relative URLs for dataURL, and not absolute URLs. To restrict cross site security attacks, FusionCharts doesn't allow colons in dataURL (starting v3.0.5). So you cannot specify dataURL as http://.../path/file.ext any more.

 

4. If you have to pass parameters to your dataURL data provider page from FusionCharts, make sure they're URLEncoded in the dataURL, when providing to FusionCharts. e.g., if your dataURL needs to be Data.asp?id=43&subId=454, you'll need to Url Encode it so that it becomes Data%2Easp%3Fid%3D43%26subId%3D454. Only then FusionCharts will invoke the URL with proper parameters appended to it.

5. When using dataURL method, make sure that the SWF File and data provider page are on the same sub-domain. Due to Flash's sandbox security model, it cannot access data from external domains, unless otherwise configured.

 

Hope this helps

Share this post


Link to post
Share on other sites

That worked! Thanks so much for your help.

 

Larry

 

Hi,

Welcome to FusionCharts Forum! smile.gif

 

If you get a "Error in Loading Data" message in your chart, it means that FusionCharts could not find XML data at the specified URL. In that case,please check the following:

 

1. Check if you've actually provided dataURL or dataXML. If you do not provide either, FusionCharts looks for a default Data.xml file in the same path. Now, if that is also not found, it shows the "Error in Loading Data" error.

 

2. If you're using dataURL method, paste this URL in your browser to check if it's returning a valid XML. Make sure, there are no scripting or time-out errors and a valid XML is being returned. Also make sure that the XML isn't intermingled with HTML content. The data provider page should return a clean XML only - not even HTML <head> or <body> tags.

 

3. Make sure you're passing relative URLs for dataURL, and not absolute URLs. To restrict cross site security attacks, FusionCharts doesn't allow colons in dataURL (starting v3.0.5). So you cannot specify dataURL as http://.../path/file.ext any more.

 

4. If you have to pass parameters to your dataURL data provider page from FusionCharts, make sure they're URLEncoded in the dataURL, when providing to FusionCharts. e.g., if your dataURL needs to be Data.asp?id=43&subId=454, you'll need to Url Encode it so that it becomes Data%2Easp%3Fid%3D43%26subId%3D454. Only then FusionCharts will invoke the URL with proper parameters appended to it.

 

5. When using dataURL method, make sure that the SWF File and data provider page are on the same sub-domain. Due to Flash's sandbox security model, it cannot access data from external domains, unless otherwise configured.

 

Hope this helps

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