Set OnZoom in Runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

Set OnZoom in Runtime

Post by msd48 » Fri Aug 29, 2008 12:32 pm

Hi!

How can I set (change) Chart.OnZoom in runtime?

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

Post by Narcís » Fri Aug 29, 2008 12:48 pm

Hi msd48,

Sorry but I don't understand which is your exact request. Are you trying to fire the OnZoom event? Would you like to zoom the chart at runtime? ...

Would you be so kind to give us some more details about what you are trying to achieve?

Thanks in advance.
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

msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

Post by msd48 » Fri Aug 29, 2008 12:53 pm

Ok.

I`ve something like this:

Code: Select all

procedure TFormMain.ChartZoom(Sender: TObject);
begin
  zoomOff;
end;

How can I change in runtime change event handler from zoomOff to zoomOff2 ?

zoomOff and zoomOff2 - it`s a procedures.

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

Post by Narcís » Fri Aug 29, 2008 1:08 pm

Hi msd48,

I can think of 2 options:

a. Use an if clause in the OnZoom event implementation:
procedure TForm1.Chart1Zoom(Sender: TObject);
begin
if condition then
zoomOff
else
zoomOff2
end;
b. Use 2 OnZoom event implementations:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.OnZoom:=Chart1Zoom;
  //Your code here
  Chart1.OnZoom:=Chart1Zoom2;
end;

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  zoomOff;
end;

procedure TForm1.Chart1Zoom2(Sender: TObject);
begin
  zoomOff2;
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

msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

Post by msd48 » Fri Aug 29, 2008 1:24 pm

Hi, Narcís

Second option - the very it!

Thanks for help.
The question is closed.

Post Reply