trendfunction change color 1 point (the last)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
SNSSEC
Newbie
Newbie
Posts: 10
Joined: Fri Nov 15, 2002 12:00 am

trendfunction change color 1 point (the last)

Post by SNSSEC » Mon Mar 01, 2010 1:05 pm

Hello,

Is there a way to change the color of one point in a values of the trendline?

regards,
Marc

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: trendfunction change color 1 point (the last)

Post by Yeray » Mon Mar 01, 2010 3:06 pm

Hi Marc,

Have you tried with the line series' GetPointerStyle event? The following code works fine for me here:

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.Area area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
            area1.FillSampleValues();

            Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            Steema.TeeChart.Functions.TrendFunction trend1 = new Steema.TeeChart.Functions.TrendFunction();
            line1.Function = trend1;
            line1.DataSource = area1;
            line1.Pointer.Visible = true;
            line1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line1_GetPointerStyle);
        }

        void line1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
        {
            if (e.ValueIndex == series.Count-1) e.Color = Color.Red;
        }   
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply