FusionCharts Forum: Invalid Xml Data Error - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Invalid Xml Data Error

#1 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 10 March 2012 - 03:33 AM

Hi,

I'm trying to to create a multi-series line chart using fusion charts free. However, i'm getting an Invalid XML data error. I have validated my xml document and there seem to be no tags misssing. I dont understand whats wrong.

Please find attached the XML file which is created. I tried pasting the file here but the contents are too big.

Any help will be much appreciated . Thanks.

-

coolspiritvv

Attached File(s)

  • Attached File  me.xml (49.56K)
    Number of downloads: 24

This post has been edited by coolspirit: 10 March 2012 - 03:35 AM

0

Other Replies To This Topic

#2 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 10 March 2012 - 04:16 AM

I think part of the problem was that I was using DataXML method and my content is too large so maybe it was truncated somewhere and i was getting an invalid xml data error. Now i changed my code to use dataURL method but now I'm getting "Error in Loading Data" . Please help.
0

Other Replies To This Topic

#3 User is offline   Swarnam 

  • Forum Guru
  • Group: Moderators
  • Posts: 291
  • Joined: 25-January 11

Posted 10 March 2012 - 08:25 AM

Hi,

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, check the following:
  • Check if you've actually provided Data URL or Data String. 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.
  • If you're using Data URL 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.
  • Make sure you're passing relative URLs for Data URL, 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.
  • When using Data URL 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.
Please find the attached screenshot.





Attached thumbnail(s)

  • Attached Image: Capture.PNG

0

Other Replies To This Topic

#4 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 10 March 2012 - 06:24 PM

Ohh Wow ... thats exactly the plot i want .... but I dont know whats wrong ... i did check all four points u mentioned but apparently everything seems to be fine .. What else do you think can be wrong ??








View PostSwarnam, on 10 March 2012 - 08:25 AM, said:

Hi,

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, check the following:
  • Check if you've actually provided Data URL or Data String. 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.
  • If you're using Data URL 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.
  • Make sure you're passing relative URLs for Data URL, 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.
  • When using Data URL 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.
Please find the attached screenshot.







0

Other Replies To This Topic

#5 User is offline   Sashibhusan 

  • Forum Guru
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 151
  • Joined: 17-November 11

Posted 12 March 2012 - 01:00 PM

Hi,

Colud you please enable the JavaScript debug mode and share result with us?

To enable debug mode write the following line of code:
var myChart = new FusionCharts( "FusionCharts/Column3D.swf","myChartId", "400", "300", "1", "1" );

Also provide the HTML file which is used for rendering the chart(if possible).

Awaiting your response!

View Postcoolspirit, on 10 March 2012 - 06:24 PM, said:

Ohh Wow ... thats exactly the plot i want .... but I dont know whats wrong ... i did check all four points u mentioned but apparently everything seems to be fine .. What else do you think can be wrong ??










This post has been edited by Sashibhusan: 12 March 2012 - 01:05 PM

0

Other Replies To This Topic

#6 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 12 March 2012 - 05:02 PM

Hi Sashibhushan,

Thanks so much for your reply. I have enbled the debug mode and here's the php script named index.php which i'm using to render the chart :


<?php

include("./includes/charts/FusionCharts.php");


?>
<HTML>
<HEAD>
<TITLE>
Build Project Duration
</TITLE>

<script LANGUAGE="Javascript" SRC="./includes/charts/FusionCharts.js"></SCRIPT>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.text{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</HEAD>
<BODY>

<CENTER>
<h2><a>Build Projects Duration</a></h2>


<?php

$strDataURL = encodeDataURL("apna.php");
$file = 'C:\web\htdocs\pages\Vishal\chart_proj\me.txt';
file_put_contents($file,$strDataURL);

echo renderChart("./includes/charts/FCF_MSLine.swf", $strDataURL,"", "FactorySum", 4000, 300, "1","1");


?>
<BR><BR>

<H5 ><a href='./?page=vishal'>&laquo; BACK </a></h5>
</CENTER>
</BODY>
</HTML>


regards,

coolspirit



View PostSashibhusan, on 12 March 2012 - 01:00 PM, said:

Hi,

Colud you please enable the JavaScript debug mode and share result with us?

To enable debug mode write the following line of code:
var myChart = new FusionCharts( "FusionCharts/Column3D.swf","myChartId", "400", "300", "1", "1" );

Also provide the HTML file which is used for rendering the chart(if possible).

Awaiting your response!


0

Other Replies To This Topic

#7 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 12 March 2012 - 05:24 PM

Also please find attsached the HTML file.

Attached File(s)


0

Other Replies To This Topic

#8 User is offline   Sashibhusan 

  • Forum Guru
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 151
  • Joined: 17-November 11

Posted 13 March 2012 - 01:27 PM

Hi,

Thank you for the post and quick response.

I was trying to replicate the issue by using your "vishal.html" file but it is rendering the chart fine.

Please find the attached screen-shot for the same.

In the PHP code that you provided, could you please verify once again that $strDataURL variable will have only XML data as a string for the chart, when you are passing as a parameter in the renderChart() function?

Awaiting your response!

Happy FusionCharting.:)

Attached thumbnail(s)

  • Attached Image: FC Free.PNG

0

Other Replies To This Topic

#9 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 15 March 2012 - 01:31 AM

Hi,

Thanks for your help. Instead of URL encode I just used file_get_contents() to fetch the contents since there are no special characters in my XML. However, all i now see is
"retrieving data. Please wait" and a progress bar which does not increase. Dont know whats wrong now. I checked the output of the file_get_contents and its a perfect xml file.

Please help.







View PostSashibhusan, on 13 March 2012 - 01:27 PM, said:

Hi,

Thank you for the post and quick response.

I was trying to replicate the issue by using your "vishal.html" file but it is rendering the chart fine.

Please find the attached screen-shot for the same.

In the PHP code that you provided, could you please verify once again that $strDataURL variable will have only XML data as a string for the chart, when you are passing as a parameter in the renderChart() function?

Awaiting your response!

Happy FusionCharting.:)

0

Other Replies To This Topic

#10 User is offline   Sashibhusan 

  • Forum Guru
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 151
  • Joined: 17-November 11

Posted 15 March 2012 - 11:19 AM

Hi,

Could you please send us the debug window information?

Also please confirm that have you pasted the chart SWF and JavaScript files (FusionCharts.js, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js) in the required folder and provided the name and path (relative path) of the chart and FusionCharts.JS file properly in your code?

Awaiting your response!
0

Other Replies To This Topic

#11 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 15 March 2012 - 12:40 PM

You mean the web console output ?? or is there some other debug window.

regards,

Vishal

View PostSashibhusan, on 15 March 2012 - 11:19 AM, said:

Hi,

Could you please send us the debug window information?

Also please confirm that have you pasted the chart SWF and JavaScript files (FusionCharts.js, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js) in the required folder and provided the name and path (relative path) of the chart and FusionCharts.JS file properly in your code?

Awaiting your response!

0

Other Replies To This Topic

#12 User is offline   coolspirit 

  • Forum Newbie
  • Group: Members
  • Posts: 8
  • Joined: 10-March 12

Posted 16 March 2012 - 02:01 AM

One more question... I think I'm using FusionCharts free and so are multi series even supported on it ??

How do i chekc if I have the free version ??

Regards,

Vishal Verma





View Postcoolspirit, on 15 March 2012 - 12:40 PM, said:

You mean the web console output ?? or is there some other debug window.

regards,

Vishal



0

Other Replies To This Topic

#13 User is offline   Sashibhusan 

  • Forum Guru
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 151
  • Joined: 17-November 11

Posted 16 March 2012 - 10:58 AM

Hi

First of all apologize for the inconvenience.

Could you please send us the live URL to look into your issue?

Also please confirm if FusionCharts.php, FusionCharts.js and FCF_MSLine.swf files are in the correct location (in the path which you are providing in the code)?

Please note that in FusionCharts Free MultiSeries Line chart is supported.(already provided the screen shot using FusionCharts Free, in the previous post)

How do i check if I have the free version ??
>>You can simply open the FusionCharts.js file in the notepad and can see the version of FusionCharts that you are using, in the very first few lines as comment lines.

Awaiting your response!
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic