I've a Devexpress XtraChart (Bar Chart) that displays gender information over range of months and years. Here is how I set some of the properties:
DataTable chartTable = new DataTable("Table1");
chartTable.Columns.Add("Gender");
chartTable.Columns.Add("MonthYear");
chartTable.Columns.Add("Value", typeof(Int32));
foreach (var p in chart.getChartData())
{
chartTable.Rows.Add(new object[] { p.Gender, p.MonthYear, p.Value });
}
// chartByGender is the name of the XtraChart control
chartByGender.DataSource = chartTable;
chartByGender.SeriesDataMember = "gender";
chartByGender.SeriesTemplate.ArgumentDataMember = "MonthYear";
chartByGender.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "value" });
chartByGender.SeriesSorting = SortingMode.None;
chartByGender.SeriesTemplate.SeriesPointsSorting = SortingMode.None;
However, when the chart is displayed it doesn't display the data in the order it is available in chartTable
. It rather sorts them and I really don't want it to do so. What properties should I change so that the series could be the same as what is in chartTable
's order?
Is there any way to force the control not to sort the data elements?