Page 1 of 1

SubChart events

Posted: Wed May 20, 2009 6:27 am
by 10548804
Is it possible to catch subcharts events for example the OnZoom event?

Best regards,
Nikemann

Posted: Wed May 20, 2009 10:53 am
by yeray
Hi Nikemann,

Yes, but you should assign them at runtime. This code works fine here:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  ChartTool1.Charts[0].Chart.Title.Visible := true;

  ChartTool1.Charts[0].Chart.OnZoom := Chart1Zoom;
  ChartTool1.Charts[0].Chart.OnUndoZoom := Chart1UnZoom;
end;

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  ChartTool1.Charts[0].Chart.Title.Text.Text := 'Zoomed';
end;

procedure TForm1.Chart1UnZoom(Sender: TObject);
begin
  ChartTool1.Charts[0].Chart.Title.Text.Text := 'UnZoomed';
end;

Posted: Wed May 20, 2009 11:28 am
by 10548804
Hi Yeray,

Tanks, it works also fin here.
My problem was, not knowing how to assign at runtime.


Best regards
Nikeman

Posted: Wed May 20, 2009 11:31 am
by yeray
Hi Nikemann,

I'm happy to be helpful!