setdataxml problem
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



setdataxml problem Expand / Collapse
Author
Message
Posted 3/30/2008 5:36:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/2/2008 1:40:59 AM
Posts: 3, Visits: 3
hye,

im trying to load graph dynamiclly with javascript xmldocument object

this is my code :

<head>

<xml id="xmlPie" src="XML/DataPie.xml"></xml>

</head>

<script>

var myChart = new FusionCharts("../../Assets/GuiObjectsV2/FusionCharts/Charts/Pie3D.swf", "myChartId", "205", "150", "1", "0");

var a = xmlPie.xml;

myChart.setDataXML(a);

 

</script>

inisde xmlPie.xml there is this xml:

<chart caption="Monthly Sales Summary" subcaption="For the year 2006" xAxisName="Month" yAxisName="Sales" numberPrefix="$"><set label="January" value="17400" /><set label="February" value="19800" /><set label="March" value="21800" /><set label="April" value="23800" /><set label="May" value="29600" /><set label="June" value="27600" /><set label="July" value="31800" /><set label="August" value="39700" /><set label="September" value="37800" /><set label="October" value="21900" /><set label="November" value="32900" /><set label="December" value="39800" /></chart>

 

and i get the error (from the debugger):

INFO: XML Data provided using dataXML method.
ERROR: Invalid XML encountered. An XML element is malformed. Click the above "dataURL Invoked" link to see the XML in browser Or check the XML data provided.

hope you can help me, im stuck.

erez.

 

Post #5328
Posted 3/30/2008 2:21:40 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/2/2008 7:57:52 PM
Posts: 1,956, Visits: 468
Your XML seems to be invalid. Please check that.

Thanks,
Pallav Nadhani
FusionCharts Team
Post #5365
Posted 3/31/2008 6:56:06 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 9:19:06 AM
Posts: 679, Visits: 1,083
Hi,

Could you try using single Quotes in the attributes of your XML file?

You can also try using myChart.setDataURL("XMLPath/DataPie.xml"); which might reduce the number of code lines used.

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5383
Posted 3/31/2008 11:10:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/2/2008 1:40:59 AM
Posts: 3, Visits: 3
how can the xml be invalid.

this is the javascript xmldocument object.

im loading it in the head - and then im pushing it to the fusion chart object - no human touch at all.

how can that be?

by the way : this is just an example - the real issue is to change the xml before loading it into the chart so it willl be dynamic ajax like.

thats why i cant use setdaraurl method.

10x !

erez/

Post #5391
Posted 3/31/2008 8:29:22 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/2/2008 7:57:52 PM
Posts: 1,956, Visits: 468
You're doing it the wrong way too. The setDataXML method expects a string value for XML.

Thanks,
Pallav Nadhani
FusionCharts Team
Post #5397
Posted 4/2/2008 1:47:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/2/2008 1:40:59 AM
Posts: 3, Visits: 3
ok,

maby i didnt get it right - i have an html page

im loading xml in the head tag

<head>

<xml id="xmlPie" src="XML/DataPie.xml"></xml>

</head>

now in the script i want to see it inside of a chart

so im doing :

var myChart = new FusionCharts("Pie3D.swf", "myChartId", "205", "150", "1", "0");

myChart.setDataXML(xmlPie.xml);

and i still get the error.

it cannot be that the xml is invalid because in javascript the object xmlPie contains xml value and is perfectly valid - this is an output from c# xmldocument

the xml example is :

<chart caption="Monthly Sales Summary" subcaption="For the year 2006" xAxisName="Month" yAxisName="Sales" numberPrefix="$"><set label="January" value="17400" /><set label="February" value="19800" /><set label="March" value="21800" /><set label="April" value="23800" /><set label="May" value="29600" /><set label="June" value="27600" /><set label="July" value="31800" /><set label="August" value="39700" /><set label="September" value="37800" /><set label="October" value="21900" /><set label="November" value="32900" /><set label="December" value="39800" /></chart>

 

he is valid - i also checked it in xml spy and in visual studio 2005 xml tool.

must be a logical explanation for this.

10x!!

erez.

Post #5418
Posted 4/8/2008 10:07:36 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/2/2008 7:57:52 PM
Posts: 1,956, Visits: 468
Pass the string representation of XML to setDataXML() method - not reference.

Thanks,
Pallav Nadhani
FusionCharts Team
Post #5495
« Prev Topic | Next Topic »


Permissions Expand / Collapse