ShapeStyles.Line to Point Outwards Around a Circle

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Ivan_vS
Newbie
Newbie
Posts: 6
Joined: Mon Sep 20, 2010 12:00 am

ShapeStyles.Line to Point Outwards Around a Circle

Post by Ivan_vS » Wed Jan 26, 2011 9:55 am

Using:
Steema.TeeChart.Styles.ShapeStyles.Line;

Could you please show me how to orientate around a circle:
Say 4 series pointing outwards with the following (conventional) coordinates:

(x0,y0) (x1,y1)
45 % (0,0) ( 1, 1)
135% (0,0) (-1,1)
225% (0,0) (-1,-1), and,
315% (0,0) ( 1,-1)

I have spent several hours on this. The behaviour of the underlying methid seems to change with the orientation and so I cannot get a consistent result.

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

Re: ShapeStyles.Line to Point Outwards Around a Circle

Post by Sandra » Wed Jan 26, 2011 11:40 am

Hello Ivan_vS,

X0, Y0, X1 and Y1 coordinates in Shape series are used to define shape's bounding rectangle. This can be best appreciated using ellipse or rectangle as ShapeStyle. To get lines behaving as you request you'd better use standard Line series instead Shape series. You can do something as next example code :

Code: Select all

public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        private void InitializeChart()
        {

            tChart1.Aspect.View3D = false;
            for (int i = 0; i < 4; i++)
            {
                new Steema.TeeChart.Styles.Line(tChart1.Chart);
                if (i == 0)
                {
                    tChart1[i].Add(0, 0);
                    tChart1[i].Add(1, 1);
                }
                else if (i == 1)
                {
                    tChart1[i].Add(0, 0);
                    tChart1[i].Add(-1, 1);
                }
                else if (i == 2)
                {
                    tChart1[i].Add(0, 0);
                    tChart1[i].Add(-1, -1);
                }
                else if (i == 3)
                {
                    tChart1[i].Add(0, 0);
                    tChart1[i].Add(1, -1);
                }
            }

        }
I hope will helps.

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