/// <summary>
/// build the data table of the chart according to the struct of the cell range
/// copy the data from the spreadsheet document table according to the cell range
/// </summary>
/// <returns>the data table</returns>
public Table CreateTableFromCellRange()
{
if (ChartPlotArea.FirstColumnHasLabels() &&
ChartPlotArea.FirstLineHasLabels())
{
BothHasLabels();
}
else if (ChartPlotArea.FirstColumnHasLabels())
{
RowHeader rowHeader = CreateRowHeader(table);
table.RowHeader = rowHeader;
for (int i = startRowIndex; i < endRowIndex; i++)
{
table.Rows.Add(m_tableData.table.Rows [i]);
}
}
else if (this.ChartPlotArea.FirstLineHasLabels())
{
FirstLineLabels();
}
else
{
NoLabels();
}
return(table);
}