I am trying to understand how the ValueList.Order property works.
If I do something like the following:
Steema.TeeChart.Styles.Line lseries = new Steema.TeeChart.Styles.Line();
chart.Series.Add(lseries);
lseries.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
lseries.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
lseries.Add(mypointsX, mypointsY);
Where (mypointsX and mypointsY are each double[] that have exactly the same number of elements.
How does the ordering occur?
The 2 array of doubles are related where mypointsX[0] and mypointsY[0] define a point to plot in the chart. It does not make sense to me that you can order lseries.Xvalues and lseries.Yvalues. If they are ordered separately, then you lose the 1:1 relationship between the array of doubles.
I am probabaly way off base here and overlooking something obvious.
Can someone clarify the behavior?
Question regarding the Order property
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
Hi Mikes
Using the code below here it keeps the 1:1 relationship between the points. The only difference is the way the line is plotted. You can also try not sorting the series and you'll notice the difference.
Using the code below here it keeps the 1:1 relationship between the points. The only difference is the way the line is plotted. You can also try not sorting the series and you'll notice the difference.
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
double[] mypointsX = new double[] { 0, 0.5, 1, 1.5 };
double[] mypointsY = new double[] { 5, 0, 15, 10 };
Steema.TeeChart.Styles.Line lseries = new Steema.TeeChart.Styles.Line();
tChart1.Series.Add(lseries);
lseries.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
lseries.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
lseries.Add(mypointsX, mypointsY);
lseries.XValues.Sort();
lseries.YValues.Sort();
lseries.Marks.Visible = true;
lseries.Marks.Style = Steema.TeeChart.Styles.MarksStyles.XY;
}