Sign in to follow this  
oceandeep

No data to display with same XML code

Recommended Posts

Hi there,

I am new to fusionchart and doing reaseach to see i can suggest this product to my company.

I have a MSColumn3DLineDY.swf chart and call it by javascript in an plain HTML file.

<script type="text/javascript"> 
 var chart_SalesByYear = new FusionCharts("FusionCharts/MSColumn3DLineDY.swf", "SalesByYear", "450", "325", "1", "1");

 //Provide entire XML data using dataXML method 
 chart_SalesByYear.setDataXML("<chart caption='Yearly Content Playback-Revenue Comparison' XAxisName='Year' palette='5' animation='1' subcaption='(Click on a column to drill-down to monthly playback in the chart below)' formatNumberScale='1' numberPrefix='' showValues='0' seriesNameInToolTip='0'><categories><category label='2005'/><category label='2006'/><category label='2007'/></categories><dataset seriesname='Licensing Revenue' alpha='50'><set value='219702' link='javaScript%3AupdateCharts%281994%29%3B'/><set value='682796' link='javaScript%3AupdateCharts%281995%29%3B'/><set value='547248' link='javaScript%3AupdateCharts%281996%29%3B'/></dataset><dataset seriesName='No. of Playbacks' parentYAxis='S' anchorSides='20'><set value='7381'/><set value='25007'/><set value='18929'/></dataset><styles><definition><style type='font' color='666666' name='CaptionFont' size='15' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles></chart>");

 //Finally, render the chart.
 chart_SalesByYear.render("SalesByYearDiv");
 </script> 

but when i replace the setDataURL to an XML file, which contain EXACTLY the same text, i.e:

chart_SalesByYear.setDataXML("xrDat.xml");

and place it in the same directory of the HTML containing the code, it will show "No data to display" error.

I am quite sure the text in the seperated XML is the same as those i used directly in the HTML page.

I am not using any web programming language to generate data, everything is static at the moment.

anybody have idea? thanks in advance.

Share this post


Link to post
Share on other sites
but when i replace the setDataURL to an XML file, which contain EXACTLY the same text, i.e:

 

 

 

chart_SalesByYear.setDataXML("xrDat.xml");

 

 

 

It seems you typed chart_SalesByYear.setDataXML("xrDat.xml"); while using data url method. For data url method, you have to write

 

chart_SalesByYear.setDataURL("xrDat.xml");

 

 

 

Also, make sure, the name of your XML file is similar to what you are using in the code (xrDat.xml)

Edited by Guest

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