hello,
I want to bind a chart with my business object.
I have a class:
class
MyData{
string _serieName;
object _xValue; double _yValue;public MyData(string serieName, object xvalue, double value) {
_serieName = serieName;
_xValue = xvalue;
_yValue = value;
}
public object XValue {get { return _xValue; } }
public string SerieName { get { return _serieName; } }public double YValue {get { return _yValue; } } }
xvalue is an object because I can have double values, datetime values or string values. I can have a chart but I want the axisX to be sorted in ascending order because when I try like that:
MyData[] testArray = new MyData[3]; testArray[0] =
new MyData"serieA", 2, 12);testArray[1] = new MyData("SerieB", 1, 16); testArray[2] =
new MyData("SerieC", 3, 15);ListProvider l = new ListProvider(testArray);CrosstabDataProvider c = new CrosstabDataProvider(); c.DataSource = l;
chart.DataSourceSettings.Fields.Add(
new FieldMap("SerieName", FieldUsage.ColumnHeading));chart.DataSourceSettings.Fields.Add(new FieldMap("XValue", FieldUsage.RowHeading) ); chart.DataSourceSettings.Fields.Add(
new FieldMap("YValue", FieldUsage.Value));chart.DataSource = testArray;
I have a good chart but labels on axisX are in this order : 2 - 1 - 3 (the order in the tab).
I think it's a normal behaviour but is there a way to display a chart with axisX sorted?
Thank you.