Highlight the chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Highlight the chart

Post by LG » Mon Jul 09, 2007 5:05 am

Dear All,

I am plotting a point series for 24 hours. I want to draw a highlight yellow from the bottom to the top when the plotting is at the current hour. For example now it's 07:00AM so I draw a highlight at the 07:00AM on XAsix straigh to the top of the chart.

Can we do this in TeeChart?

Regards,

LG

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

Post by Edu » Mon Jul 09, 2007 8:48 am

Hi LG

You can do it, with ColorLine Tool as below code:

Code: Select all

        ColorLine colorLine1;
        private void Form1_Load(object sender, EventArgs e)
        {
            Random rnd = new Random();
            line1.XValues.DateTime = true;
            line1.Add(DateTime.Parse("9/7,07 10:25"), rnd.Next());
            line1.Add(DateTime.Parse("9/7,07 10:30"), rnd.Next());
            line1.Add(DateTime.Parse("9/7,07 10:35"), rnd.Next());
            line1.Add(DateTime.Parse("9/7,07 10:40"), rnd.Next());
            line1.Add(DateTime.Parse("9/7,07 10:45"), rnd.Next());
            line1.Add(DateTime.Parse("9/7,07 10:50"), rnd.Next());
    
            DateTime now = DateTime.Now; 

            colorLine1 = new ColorLine(tChart1.Chart);
            colorLine1.AllowDrag = false;  
            colorLine1.Axis = tChart1.Axes.Bottom; 
            colorLine1.Pen.Color = Color.Yellow;
            colorLine1.Value = now.ToOADate();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            DateTime now = DateTime.Now;
            colorLine1.Value = now.ToOADate();
        }
Best Regards,
Edu

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

Post Reply