Question regarding the Order property

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mike Jones
Advanced
Posts: 192
Joined: Thu Feb 01, 2007 12:00 am
Contact:

Question regarding the Order property

Post by Mike Jones » Thu Apr 19, 2007 6:32 pm

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?

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Fri Apr 20, 2007 10:18 am

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.

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;         

        }
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Post Reply