Sign in to follow this  
eagles9999

I guess I am missing something

Recommended Posts

I have been using earlier versions of Fusion Charts for many years and am now trying to implement using 3.4

 

I seem to be having some issues using an external xml data file.

 

Using the example below with the data in the html file, it works. All good.

 

sample1.html

 

<html>
<head>
<title>My First chart using FusionCharts Suite XT</title>
<script type="text/javascript" src="../fusioncharts/fusioncharts.js"></script>
<script type="text/javascript" src="../fusioncharts/themes/fusioncharts.theme.fint.js"></script>
<script type="text/javascript">
FusionCharts.ready(function () {
    var myChart = new FusionCharts({
      "type": "column2d",
      "renderAt": "chartContainer",
      "width": "500",
      "height": "300",
      "dataFormat": "xml",
      "dataSource": "<chart caption='Harrys SuperMart' subcaption='Monthly revenue for last year' xaxisname='Month' yaxisname='Amount' numberprefix='$' palettecolors='#008ee4' bgalpha='0' borderalpha='20' canvasborderalpha='0' theme='fint' useplotgradientcolor='0' plotborderalpha='10' placevaluesinside='1' rotatevalues='1' valuefontcolor='#ffffff' captionpadding='20' showaxislines='1' axislinealpha='25' divlinealpha='10'><set label='Jan' value='420000' /><set label='Feb' value='810000' /><set label='Mar' value='720000' /><set label='Apr' value='550000' /><set label='May' value='910000' /><set label='Jun' value='510000' /><set label='Jul' value='680000' /><set label='Aug' value='620000' /><set label='Sep' value='610000' /><set label='Oct' value='490000' /><set label='Nov' value='900000' /><set label='Dec' value='730000' /></chart>"
    });
 
  myChart.render();
});
</script>
</head>
<body>
  <div id="chartContainer">FusionCharts XT will load here!</div>
</body>
</html>
 
 
 
However, if I now split the data out into an external xml file I get No Data to Display.
 
Here is the html.... sample2.html
 
<html>
<head>
<title>My First chart using FusionCharts Suite XT</title>
<script type="text/javascript" src="../fusioncharts/fusioncharts.js"></script>
<script type="text/javascript" src="../fusioncharts/themes/fusioncharts.theme.zune.js"></script>
<script type="text/javascript">
FusionCharts.ready(function () {
    var myChart = new FusionCharts({
      type: 'column2d',
      renderAt: 'chartContainer',
      width: '500',
      height: '300',
      dataFormat: 'xmlurl',
      datasource: 'sample2.xml',
    });
  myChart.render();
});
</script>
</head>
<body>
  <div id="chartContainer">FusionCharts XT will load here!</div>
</body>
</html>
 
 
And here is the xml file.... sample2.xml
 
<chart caption='Harry's SuperMart' subcaption='Monthly revenue for last year' xaxisname='Month' yaxisname='Amount' numberprefix='$' palettecolors='#008ee4' bgalpha='0' borderalpha='20' canvasborderalpha='0' useplotgradientcolor='0' plotborderalpha='10' placevaluesinside='1' rotatevalues='1' valuefontcolor='#ffffff' captionpadding='20' showaxislines='1' axislinealpha='25' divlinealpha='10'>
  <set label='Jan' value='420000' />
  <set label='Feb' value='810000' />
  <set label='Mar' value='720000' />
  <set label='Apr' value='550000' />
  <set label='May' value='910000' />
  <set label='Jun' value='510000' />
  <set label='Jul' value='680000' />
  <set label='Aug' value='620000' />
  <set label='Sep' value='610000' />
  <set label='Oct' value='490000' />
  <set label='Nov' value='900000' />
  <set label='Dec' value='730000' />
</chart>
 
Can anyone please suggest what might be the issue.
 
Cheers,
Mark

Share this post


Link to post
Share on other sites

Hi Moonmi,

 

Thank you for the link and sample.

 

However, trying the two samples contained in there,  the sample1 which uses inline data works perfectly, but the sample2 which calls the external data does not work. The screen changes to "Retrieving Data. Please Wait"  and then nothing.

 

Any suggestions please?

Share this post


Link to post
Share on other sites

Hi,

 

We are unable to replicate the issue. The file renders without any issue at our end (Screenshot attached)

 

Could you confirm if you rendering the chart from a local system or server? Because when charts are rendered as external file it needs to be rendered in a local server for browser security purpose.

 

Thanks.

 

post-62873-0-82773000-1413183088_thumb.jpg

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