anitsirc

Cross Domain Data.xml Not Loading

Recommended Posts

Hi,

 

I've been having some problems loading the Data.xml file, I've updated my charts from v1.2.4 to v3.2.1. Before i had no problem loading my xml from a different ip address, but since i upgrade the charts it doesn't render the chart, just display the default text for charts with no data. I have my crossdomain.xml file just as it was before, so there shouldn't be any problems bc of that.

Here's the call that i'm doing and the server where this is running is 190.168.2.90

 

 

<div id="chartdiv0" align="center">
The chart will appear here
</div>
<script type="text/javascript">
 var myChart = new FusionCharts('/Charts/MultiAxisLine.swf?XMLLoadingText=Retrieving Data. Please Wait.&ChartNoDataText=No data to display.', 'chart1', '960', '480', '0', '1');
 myChart.setXMLUrl('http://192.168.2.92/Data.xml');
 myChart.render("chartdiv0");
</script>

 

 

Am I missing something or there is another way to do this?

 

Thanks in advance

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

You would need to keep all js files, swf files and xml file on the server.

 

Please make sure that the js files and swf files should be in the same folder.

 

Hope this helps.smile.gif

Edited by Angie

Share this post


Link to post
Share on other sites

Hi Angie,

 

All my servers have all the xml, swf and js files and the js and swf files are in the same folder, but it keeps failing. If I change the swf files to the old ones it displays the charts, when i change them to the v3.2 it shows the "No data to display" message :s

 

Does it affect that I'm using the trial version, instead of the full one?

 

Regards

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Could you please send us any live link to check the issue from our end?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

Hi,

Unfortunately i don't have a live link to send, but this is what it shows when i debug the chart.

 

 

Info: Chart loaded and initialized.
Initial Width: 960
Initial Height: 480
Scale Mode: noScale
Debug Mode: Yes
Application Message Language: EN
Version: 3.2.1
Chart Type: Single Series 2D Column Chart
Chart Objects: 
BACKGROUND
CANVAS
CAPTION
SUBCAPTION
YAXISNAME
XAXISNAME
DIVLINES
YAXISVALUES
HGRID
DATALABELS
DATAVALUES
TRENDLINES
TRENDVALUES
DATAPLOT
TOOLTIP
VLINES
VLINELABELS

INFO: Chart registered with external script. DOM Id of chart is chart1Id
INFO: XML Data provided using dataURL method.
dataURL provided: http://192.168.2.92/Data.xml
dataURL invoked: http://192.168.2.92/Data.xml?FCTime=834
INFO: setDataXML method invoked from external script.
INFO: XML Data provided using dataXML method.
XML Data: null
No Data to Display: No data was found in the XML data document provided. Possible cases can be: 
There isn't any data generated by your system. If your system generates data based on parameters passed to it using dataURL, please make sure dataURL is URL Encoded.
You might be using a Single Series Chart .swf file instead of Multi-series .swf file and providing multi-series data or vice-versa.

 

When i click to the link of dataURL provided, this is what it has

<chart plotGradientColor=''
 yAxisMaxValue='100'
 yAxisMinValue='0'
 bgAlpha='0'
 bgColor='000000'
 caption='Question: Hvornår besøgte du sidst TDC Butik? Interviews: 16514 Period: 28-12-2010 til 01-02-2011'
 exportAtClient='1'
 exportDialogMessage='Capturing Data : '
 exportEnabled='1'
 exportHandler='fcExporter1'
 labelDisplay='WRAP'
 defaultAnimation='1'
 showAboutMenuItem='1'
 showBorder='0'
 showExportDataMenuItem='1'
 showExportDialog='1'
 showPrintMenuItem='0'
 showValues='1'
 slantLabels='1'
 xAxisName='Svar'
 yAxisName='Procent'> 

<set color='008050' alpha='100' label='Under 2 uger siden' value='17'></set> 
<set color='008050' label='2-4 uger siden' value='16'></set> 
<set color='008050' label='1-3 måneder siden' value='23'></set> 
<set color='008050' label='Over 3 måneder siden' value='27'></set> 
<set color='008050' label='Dette er mit første besøg' value='3'></set> 
<set color='008050' label='Husker ikke' value='14'></set> 

<styles> 
  <definition> 
     <style name='microtingCaptionFont' type='font' font="Verdana" size="12" align='left'/> 
     <style name='microtingLabelFont' type='font' font="Verdana" size="10" align='center' />
  </definition>
  <application>
     <apply toObject='Caption' styles='microtingCaptionFont' />
     <apply toObject='SubCaption' styles='microtingCaptionFont' />
     <apply toObject='DataLabels' styles='microtingLabelFont' />
  </application>
  </styles>
</chart>

 

 

 

The error that chrome console displays is

 

XMLHttpRequest cannot load http://192.168.2.92/test.xml. Origin http://192.168.2.90 is not allowed by Access-Control-Allow-Origin.

 

And my cross domain file (that works ok with the older version of fusion charts is)

 


<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy> 
 <allow-access-from domain="192.168.2.90" />  
 <allow-access-from domain="192.168.2.91" />
 <allow-access-from domain="192.168.2.92" />
</cross-domain-policy>

 

 

I don't know if there is any other information that you might find useful

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

FusionCharts v 3.2 does not allow flash to fetch data, it allows ajax to fetch data.

 

You would need to allow cross domain policy for ajax, the same way you did it earlier for flash.

 

This is nothing but a browser issue.

 

Hope this helps.smile.gif

Share this post


Link to post
Share on other sites

I am having the same problem. I took the HTML5 javascript example (see this page) and saved it to my local drive. I verified it all worked. Below is the code:

 

FusionCharts.setCurrentRenderer('JavaScript');
var myChart = new FusionCharts("Column3D.swf", "myChartId", "400", "300", "1", "1");
myChart.setXMLUrl("Data.xml");
myChart.render("chartContainer");

 

I then changed the url from Data.xml to http://www.fusioncharts.com/Code/MyFirstChart/data.xml and I then get the "No Data to Display" message.

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

Welcome to FusionCharts Forum!smile.gif

 

Please make sure that the js files and swf files should be in the same folder.

 

Hope this helps.smile.gif

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

We are glad to know that you have managed to solve your purpose.

 

Keep FusionCharting!biggrin.gif

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