XML Model Formats

WebCharts3D software supports two alternative formats for XML representation of chart's model - default and crosstab. Both formats describe a two-dimensional table that is used to create chart's model. Any model can be written as XML, but when a model is recreated from XML WebCharts3D API will return an instance of MxStandardChartModel. The examples in this section describe the following table:

 Year2000Year2001
Assets100200
Liabilities150300


Default Format

In the default format the table is defined row-by-row:

<XML [type="default"]>
   <COL>Column label1</COL>
   <COL>Column label2</COL>
   ...
   <ROW attr1="value" attr2="value" ... >Row label</ROW>
   <ROW attr1="value" attr2="value" ... >Row label</ROW>
   ...
</XML>

The number of the <COL> elements in this format should match the number of the attributes in each row. You can specify empty strings as the attributes' values to create gaps in the chart. Optionally, you can omit <COL> elements completely. In this case, the labels are automatically produced from the first row. The shorthand notation is convenient when your column labels do not contain special characters.

Example:

<XML>
   <COL>Year2000</COL>
   <COL>Year2001</COL>
   <ROW col0="100.0" col1="200.0">Assets</ROW>
   <ROW col0="150.0" col1="300.0">Liabilities</ROW>
</XML>
defines the same table as
<XML>
   <ROW Year2000="100.0" Year20001="200.0">Assets</ROW>
   <ROW Year2000="150.0" Year2001="300.0">Liabilities</ROW>
</XML>

Crosstab Format

In the crosstab format each ROW element of the xml specifies value for the particular row and column.

<XML type="crosstab">
   <ROW rowLabel="rowLabel" colLabel="colLabel" value="value"/>
   <ROW rowLabel="rowLabel" colLabel="colLabel" value="value"/>
   ...
</XML>

Example:

<XML type="crosstab">
   <ROW rowLabel="Assets" colLabel="Year2000" value="100.0"/>
   <ROW rowLabel="Assets" colLabel="Year2001" value="200.0"/>
   <ROW rowLabel="Liabilities" colLabel="Year2000" value="150.0"/>
   <ROW rowLabel="Liabilities" colLabel="Year2001" value="300.0"/>
</XML>