OpenWPFChart Data XML format can store multiple series of 2D and 3D data points.
OpenWPFChart Data XML document is validated against an XSD schema which is constructed dynamically basing on the contents of type mapping XML file (see below).
That's the example of XML data file contents:
<?xml version="1.0" encoding="utf-8"?> <Items xmlns="urn:ItemData-schema"> <Points.Date.Double YName="y=temperature" XName="Month"> <Point x='2008-01-01' y='-20'/> <Point x='2008-02-01' y='-25'/> ... <Point x='2008-12-01' y='-17'/> </Points.Date.Double> ... <Points.Double ItemType="ScatteredPoints" YName="Point Set 2"> <Point x="0.01" y="0.5"/> ... <Point x="0.95" y="0.3"/> </Points.Double> ... </Items>
The root content element is introduced by the Items tag. This element can contain any number of Point Series. In the sample snippet above two series are presented by their Points.Date.Double and Points.Double elements.
First series contains point of type Date in x dimension and Double in y dimension.
Second series contains point of type Double in both dimensions. Its ItemType is set to ScatteredPoints which indicates that the series represents the points cloud.
ItemType attribute of the series element tag expresses the intention on the series usage. E.g. the first would be treated by an application as the set of the sampled curve points and the second one as the set of points of the points cloud.
Every series element may have optional YName and XName attributes. The former corresponds to OpenWPFChart.Parts.ItemData.ItemName property and the latter can be used by an application to show the abscissas axis label.
Specific series element may imply additional restrictions: e.g. series with ItemType attribute missed or equal to the "SampledCurve" value requires its Point elements be ordered by abscissa (x) values.
A series element must contain one or more Point elements.
Every Point element must have x (for abscissa) and y (for ordinate) attributes. Point coordinate values in the series must be convertible to the same base type.
Base type is determined by the first Point element attribute (x or y) values in the following manner:
Point series element is named according to the following patterns:
Pints.<dimensions base type> or Pints.<x-dimension base type>.<y-dimension base type> or Pints.<x-dimension base type>.<y-dimension base type>.<z-dimension base type>
The first pattern is applied to 2D data if both x and y dimensions have the same base type. The thirs pattern is for 3D point series.
Base type strings come from mapping XML document which also maps Base type string values to XSD and .NET type names. That's the example of mapping XML document:
<Mappings xmlns="urn:ItemData-mapping"> <Mapping> <XAxis xsd-type="int" net-type="System.Double" type-string="Int"/> <YAxis xsd-type="int" net-type="System.Double" type-string="Int"/> </Mapping> <Mapping> <XAxis xsd-type="double" net-type="System.Double" type-string="Double"/> <YAxis xsd-type="dateTime" net-type="System.DateTime" type-string="DateTime"/> </Mapping> ... <Mapping> <XAxis xsd-type="date" net-type="System.DateTime" type-string="Date"/> <YAxis xsd-type="date" net-type="System.DateTime" type-string="Date"/> </Mapping> </Mappings>
The first mapping in this example describes the point series element with "Points.Int" name. This element must contain points of XSD "int" type in both dimentions which will be converted to the System.Double values by the parser.
The second mapping describes the point series element with "Points.Double.DateTime" name. This element must contain points of XSD "double" type in x dimention and XSD "dateTime" type in y dimension. The former will be converted to values of the System.Double type and the latter to value of System.DateTime type by the parser.
You could guess that the last mapping describes the point series element with "Points.Date" name.
All OpenWPFChart sample applications allowing to load data from xml files have mapping XML document embedded as a Resource. Each defines data types acceptable for its application. For list of types allowed see application directory Readme.txt.