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
Highlight the chart
Hi LG
You can do it, with ColorLine Tool as below code:
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();
}