Sorted points in Polar Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
hb-dru
Newbie
Newbie
Posts: 5
Joined: Fri Dec 07, 2012 12:00 am

Sorted points in Polar Chart

Post by hb-dru » Sat Apr 06, 2013 6:22 am

I am adding points to a polar series:

Code: Select all

            mRoundnessSeries.Add(0, 40);
            mRoundnessSeries.Add(60, 80);
            mRoundnessSeries.Add(120, 120);
            mRoundnessSeries.Add(180, 160);
            mRoundnessSeries.Add(150, 150);
What I am then seeing is:

Image

But what I would like to see is:

Image

I had already tried to set

Code: Select all

 mRoundnessSeries.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending; 
but that did not change anything in the display.

Any idea on how I can achieve the desired sorted display of points?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Sorted points in Polar Chart

Post by Sandra » Mon Apr 08, 2013 8:46 am

Hello hb-dru,

If you want order the values, you need add the type of order but you need sort the values, too. You must add after select the type order the method Sort() as do in next line of code:

Code: Select all

mRoundnessSeries.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
mRoundnessSeries.XValues.Sort(); 
Could you confirm if it works in your end?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

hb-dru
Newbie
Newbie
Posts: 5
Joined: Fri Dec 07, 2012 12:00 am

Re: Sorted points in Polar Chart

Post by hb-dru » Tue Apr 09, 2013 5:21 am

I now changed my code to

Code: Select all

 mRoundnessSeries.Add(0, 40);
            mRoundnessSeries.Add(60, 80);
            mRoundnessSeries.Add(120, 120);
            mRoundnessSeries.Add(180, 150);
            mRoundnessSeries.Add(150, 160);
            mRoundnessSeries.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
            mRoundnessSeries.XValues.Sort();
but still the points are not displayed in sorted order. (They are still displayed as shown in the first picture above.)

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Sorted points in Polar Chart

Post by Sandra » Tue Apr 09, 2013 9:12 am

Hello hb-dru,

Could you tell us which version of TeeChartFor.Net are you using? Because, I inform you, next code works in correct way in last version of TeeChartFor.Net build number(4.1.2012.01312)

Code: Select all

       private void InitializeChart()
        {
            tChart1.Aspect.View3D= false;
            tChart1.Legend.LegendStyle = LegendStyles.Series; 
            //Initialize PolarSeries
            Steema.TeeChart.Styles.Polar polar1 = new Polar(tChart1.Chart);
            polar1.Circled = true;
            polar1.CircleLabels = true;
            polar1.CircleLabelsRotated = true;
            polar1.RotationAngle = 90;
            polar1.CloseCircle = false;
            polar1.bBrush.Visible = false; 
            //Populate
            polar1.Add(0, 40);
            polar1.Add(60, 80);
            polar1.Add(120, 120);
            polar1.Add(180, 160);
            polar1.Add(150, 150);
            //Color and Pointer
            polar1.Color = Color.Green;
            polar1.Pen.Color = polar1.Color; 
            polar1.Pointer.Visible = true;
            polar1.Pointer.Style = PointerStyles.Circle;
            polar1.XValues.Order = ValueListOrder.Ascending;
            polar1.XValues.Sort();
            //Axes
            tChart1.Axes.Bottom.SetMinMax(0, 200);
            tChart1.Axes.Left.SetMinMax(0, 200);
        }
Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

hb-dru
Newbie
Newbie
Posts: 5
Joined: Fri Dec 07, 2012 12:00 am

Re: Sorted points in Polar Chart

Post by hb-dru » Wed Apr 10, 2013 5:48 am

I have version 4.1.2012.9283 of TeeChart and I can confirm that your code sample works as expected. But the test data you are using is not the same as in my sample. You are using:

Code: Select all

            polar1.Add(0, 40);
            polar1.Add(60, 80);
            polar1.Add(120, 120);
            polar1.Add(180, 160);    // y-Value is 160. This is not what I have in my data.
            polar1.Add(150, 150);    // y-Value is 150. This is not what I have in my data.
but I want

Code: Select all

            polar1.Add(0, 40);
            polar1.Add(60, 80);
            polar1.Add(120, 120);
            polar1.Add(180, 150);
            polar1.Add(150, 160);
and if I use the data that I want with your sample the points still do not get sorted in ascending angle order.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Sorted points in Polar Chart

Post by Sandra » Wed Apr 10, 2013 8:21 am

Hello hb-dru,

Sorry, I have used your initial data. I have try to reproduce your problem again, using 4.1.2012.9283 and 4.1.2012.01312 and finally I can reproduce your problem. But, I have checked the same code using last TeeChartFor.Net source code and the problem is solved. For this reason, I inform you the problem is fixed for next maintenance release of TeeChartFor.Net. At the moment, you can change the order manually of your data as a workaround. Please see next code:

Code: Select all

  private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            tChart1.Legend.LegendStyle = LegendStyles.Series;
            //Initialize PolarSeries
            Steema.TeeChart.Styles.Polar polar1 = new Polar(tChart1.Chart);
            polar1.Circled = true;
            polar1.CircleLabels = true;
            polar1.CircleLabelsRotated = true;
            polar1.RotationAngle = 90;
            polar1.CloseCircle = false;
            polar1.bBrush.Visible = false;
            //Populate
            polar1.Add(0, 40);
            polar1.Add(60, 80);
            polar1.Add(120, 120);
            polar1.Add(150, 160);
            polar1.Add(180, 150);
            //Color and Pointer
            polar1.Color = Color.Green;
            polar1.Pen.Color = polar1.Color;
            polar1.Pointer.Visible = true;
            polar1.Pointer.Style = PointerStyles.Circle;
            //polar1.XValues.Order = ValueListOrder.Ascending;
            //polar1.XValues.Sort();
            //Axes
            tChart1.Axes.Bottom.SetMinMax(0, 200);
            tChart1.Axes.Left.SetMinMax(0, 200);
        }
Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

hb-dru
Newbie
Newbie
Posts: 5
Joined: Fri Dec 07, 2012 12:00 am

Re: Sorted points in Polar Chart

Post by hb-dru » Fri Apr 19, 2013 1:57 pm

Any idea on when the next maintenance release will be available?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Sorted points in Polar Chart

Post by Sandra » Fri Apr 19, 2013 2:28 pm

Hello hb-dru,

Sorry but I can not provide you a estimate date. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply