GetASeries Method

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
CCRyder
Newbie
Newbie
Posts: 19
Joined: Fri Aug 11, 2006 12:00 am
Location: Germany
Contact:

Post by CCRyder » Thu Sep 21, 2006 12:04 pm

Hi Narcis,
In the example I sent to you the were 3 TColorLineTools that I use for marking the current day and time. When I scoll left or right, the color marks move beyond the axis until they are off the form. How can I get the color lines to deactivate when they are outside of the left or right axis without freeing them?
Regards,
CCRyder

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

Post by Narcís » Thu Sep 21, 2006 2:21 pm

Hi CCRyder,

You can use something like the snippet below and some additional tricks I added on the original project you sent. I'm going to post the project in the attachments newsgroup.

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var i: Integer;
begin
  With Chart1.Tools do
  begin
    for i := 0 to Count - 1 do
      if (Items[i] is TColorLineTool) then
      begin
        if (((Items[i] as TColorLineTool).Value > Chart1.Axes.Top.Maximum) or
          ((Items[i] as TColorLineTool).Value < Chart1.Axes.Top.Minimum)) then
          Items[i].Active:=false
        else
          Items[i].Active:=true;
      end;
  end;
            
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
Image Image Image Image Image Image
Instructions - How to post in this forum

CCRyder
Newbie
Newbie
Posts: 19
Joined: Fri Aug 11, 2006 12:00 am
Location: Germany
Contact:

Post by CCRyder » Thu Sep 21, 2006 2:48 pm

Excellent!
Thanks Narcis

I'm very impressed with TeeChart and your fantastic support!
Regards,
CCRyder

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

Post by Narcís » Thu Sep 21, 2006 2:56 pm

Hi CCRyder,

You're very welcome! I'm glad to hear my suggestions were helpful.
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