Jump to content
Software FX Community

business object


jusim

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...