Sign in to follow this  
lipilates

XML structure inside setDataXML

Recommended Posts

When using the setDataXML as an option for data, is there a specific requirment to build the XML data in a single line without any Crt or tabs?

 

 

 

When I'm looking on the XML in all examples all are like:

 

 

 

 

 

 

 

 

 

 

 

and when it is inside the setDataXML like that:

 

setDataXML("");

 

 

 

WHAT IS THE RIGHT WAY and is there any differece????

 

 

 

Yossi

Share this post


Link to post
Share on other sites

Hi Yossi,

Due to javascript programming when you provide xml data by setDataXML method then XML data must be in a single line without any Crt or tabs. If data comes from direct XML file i.e data.xml that time data will be in normal xml style. Please see the example.

 

var strXML="<graph xAxisName='' yAxisName='' caption='' subCaption='' decimalPrecision='0' rotateNames='1' numDivLines='3' numberPrefix='' showValues='0' formatNumberScale='0'>";

strXML += "<categories>";

strXML += "<category name=''/>";

strXML += "</categories>";

strXML += "<dataset seriesName='Risk Range' color='FF0000' showValues='0'>"

strXML += "<set value='100' />";

strXML += "</dataset>";

strXML += "</graph>";

setDataXML(strXML);

Edited by Guest

Share this post


Link to post
Share on other sites
zhmq0124v (8/11/2008)
I tried to use DataURL, it works.

 

 

 

So is it because dataXML's length limit?

 

 

 

I had similar problems when switching from a file based execution (setDataURL(...)) to a string based execution (setDataXML(...)). It turned out that I had special characters (e.g. %) in my string which, if loaded from file didn't cause any problems, but did when inputting the same XML as a string through setDataXML.

 

 

 

Once I removed all reserved characters from my XML string, the chart rendered fine even when initialized with na XML string instead of a file URL.

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