I'm trying to read an XML file to populate a Gantt chart. I have created a sample chart in a WinForm app, populated it with data from code, and exported the XML schema for the properties as follows:
<?xml version="1.0" encoding="UTF-8"?>
<CFX7>
<PANES>
<ITEM index="0">
<AXES>
<ITEM index="0">
<LABELSFORMAT>
<FORMAT>Date</FORMAT>
</LABELSFORMAT>
<POSITION>Far</POSITION>
<TITLE>
<TEXT></TEXT>
</TITLE>
</ITEM>
</AXES>
</ITEM>
</PANES>
<AXESX>
<ITEM index="0">
<GRIDS>
<MAJOR>
<VISIBLE>False</VISIBLE>
</MAJOR>
</GRIDS>
<LABELS>
<ITEM>P2</ITEM>
<ITEM>P1</ITEM>
</LABELS>
<TITLE>
<TEXT></TEXT>
</TITLE>
</ITEM>
</AXESX>
<ALLSERIES>
<GALLERYARRAY type="ChartFX.WinForms.Internal.IGalleryType[]">
<ITEM index="0" type="ChartFX.WinForms.Galleries.Line"/>
<ITEM index="19" type="ChartFX.WinForms.Galleries.Bar"/>
</GALLERYARRAY>
<GALLERY>Gantt</GALLERY>
</ALLSERIES>
<SERIES>
<ITEM index="0"/>
</SERIES>
<LEGENDBOX>
<VISIBLE>False</VISIBLE>
</LEGENDBOX>
<DATAGRID>
<VISIBLE>True</VISIBLE>
</DATAGRID>
<BORDER type="ChartFX.WinForms.Adornments.ImageBorder" assembly="ChartFX.WinForms.Adornments, Version=7.0.4770.21916, Culture=neutral, PublicKeyToken=a1878e2052c08dce"/>
<BACKGROUND type="ChartFX.WinForms.Adornments.GradientBackground" assembly="ChartFX.WinForms.Adornments, Version=7.0.4770.21916, Culture=neutral, PublicKeyToken=a1878e2052c08dce">
<COLORS type="ChartFX.WinForms.Adornments.GradientBackground+ColorCollection" assembly="ChartFX.WinForms.Adornments, Version=7.0.4770.21916, Culture=neutral, PublicKeyToken=a1878e2052c08dce"/>
</BACKGROUND>
</CFX7>
Now I can't figure out what is the XML format for the data. In the docs it's said that we need to provide a pair of values for each data point, which in code is done by assigning values to the YFrom and Y properties, like this:
chart.AxisX.Labels[nPoints] = "P2";
chart.Data.YFrom[nSeries, nPoints] = new DateTime(2013, 8, 30).ToOADate();
chart.Data.Y[nSeries, nPoints] = new DateTime(2013, 9, 30).ToOADate();
So I tried the following data XML, and many other combinations and formats, but no success:
<CHARTFX>
<COLUMNS>
<COLUMN NAME="Project" TYPE="String"/>
<COLUMN NAME="Start" TYPE="Float"/>
<COLUMN NAME="Finish" TYPE="Float" />
</COLUMNS>
<ROW Project="P2" Start="41518" Finish="41562"/>
<ROW Project="P1" Start="41516" Finish="41547"/>
</CHARTFX>
But the result with this is two bars for each Project, and not a single bar starting and finishing at the desired dates (note that I have transformed the dates to the OADate equivalent, as I was getting errors using the Date or DateTime type for the columns).
Can anyone help me, please! This is really important and urgent!
Thanks in advance!