Extending TCursorTool to display over Custom Axes.

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Phineas
Newbie
Newbie
Posts: 18
Joined: Wed Apr 09, 2008 12:00 am

Extending TCursorTool to display over Custom Axes.

Post by Phineas » Thu Dec 03, 2009 9:18 pm

I want the vertical line of the TCursorTool to also extend across my custom axes. I want the tool to be assiged to Series1, but to display over other Series on custom axes. I figure I can spend some time coding this but do you folk have a quick method I can use.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Extending TCursorTool to display over Custom Axes.

Post by Narcís » Fri Dec 04, 2009 9:12 am

Hi Phineas,

The easiest solution I can think of now is using a TColorLineTool for that, for example:

Code: Select all

procedure TForm1.ChartTool1Change(Sender: TCursorTool; x, y: Integer;
  const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
begin
  ColorLine.Value:=ChartTool1.XValue;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  ColorLine:=TColorLineTool.Create(Self);
  ColorLine.Axis:=Series2.GetHorizAxis;
  ColorLine.Pen.Color:=ChartTool1.Pen.Color;

  ColorLine.Value:=ChartTool1.XValue;
end;
Hope this helps!
Best Regards,
Narcís Calvet / 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