Adding Line to Chart
Adding Line to Chart
I am using Delphi 2006 Professional with Teechart Pro 7.12. I have a dbChart filled with lines series. I want to allow the user to set a threshold line on the chart. I want to have the user select a number within the Y axis range and have a horizontal line appear in the dbChart. Can anyone guide me how I could programmatically have that line added to the chart?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi McMClark,
Yes, you can use a TColorLineTool for that, for example:
Hope this helps!
Yes, you can use a TColorLineTool for that, for example:
Code: Select all
uses TeeTools;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var ColorLine1: TColorLineTool;
begin
ColorLine1:=TColorLineTool.Create(self);
Chart1.Tools.Add(ColorLine1);
ColorLine1.Axis:=Chart1.Axes.Left;
ColorLine1.AllowDrag:=false;
ColorLine1.Pen.Color:=clRed;
ColorLine1.Value:=Chart1.Axes.Left.CalcPosPoint(Y);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |