Charts > Using the Charts Library > The IlvXMLChartData Class > Introducing the IlvXMLChartData Class
 
Introducing the IlvXMLChartData Class
The class IlvXMLChartData derives from IlvAbstractChartData and reads one or several data sets from an XML file. The XML file should conform to the following DTD:
<?xml version="1.0" encoding="UTF-8"?>
 
<!ELEMENT chartData (data+)>
<!ATTLIST chartData xmlns:ilvchart CDATA #FIXED
"http://www.roguewave.com/products/jviews/chart"
version CDATA #REQUIRED>
 
<!ELEMENT data (series+)>
<!ATTLIST data xSeries IDREF #IMPLIED>
 
<!ELEMENT series ((value | valuesList)*, property*)>
<!ATTLIST series dateFormat CDATA #IMPLIED
type (double | date) #REQUIRED
id ID #REQUIRED>
 
<!ELEMENT value (#PCDATA)>
 
<!ELEMENT valuesList (#PCDATA)>
<!ATTLIST valuesList delimiter CDATA #IMPLIED>
<!ENTITY % propertyExt "">
<!ELEMENT property (#PCDATA %propertyExt;)*>
<!ATTLIST property name CDATA #REQUIRED
value CDATA #IMPLIED>
 
<!ELEMENT seriesRef EMPTY>
<!ATTLIST seriesRef ref IDREF #REQUIRED>
For example, assuming that a chart contains three data sets: two (DS_A and DS_B) which do not use xvalues series, and one (DS_C) which uses a specific series for its abscissa, the resulting XML file is:
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<chartData version="0.3">
<data>
<series id="DS_A" type="double">
<valuesList>0.0,8.0,6.0,13.0,22.0,21.0,19.0,28.0,27.0,23.0</valuesList>
</series>
<series id="DS_B" type="double">
<valuesList>0.0,9.0,11.0,14.0,11.0,16.0,19.0,21.0,12.0,12.0</valuesList>
</series>
</data>
<data xSeries="X_DS_C">
<series id="X_DS_C" type="double">
<valuesList>0.0,2.0,4.0,6.0,8.0,10.0,12.0,14.0,16.0,18.0</valuesList>
</series>
<series id="DS_C" type="double">
<valuesList>0.0,0.0,6.0,3.0,0.0,2.0,9.0,18.0,9.0,5.0</valuesList>
</series>
</data>
</chartData>
</pre>

Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.