Hello,
I am looking for an event on the TPageNumTool in order to change the chart title when the number of page change.
I have tested with the event on click but it is not fired when the page change only when we click on the tool
Thanks for help
Regards
PageNumTool and event
Re: PageNumTool and event
Hi Calou,
There is not a public event for the tool but there is an event for the chart pages, the OnPageChange event. You can use assign it at design time or at runtime as follows:
There is not a public event for the tool but there is an event for the chart pages, the OnPageChange event. You can use assign it at design time or at runtime as follows:
Code: Select all
procedure Chart1PageChange(Sender: TObject);
//...
uses Series, TeePageNumTool;
procedure TForm1.FormCreate(Sender: TObject);
begin
with Chart1.AddSeries(TBarSeries) do FillSampleValues(25);
Chart1.Tools.Add(TPageNumTool);
Chart1.Pages.MaxPointsPerPage:=5;
Chart1.OnPageChange:=Chart1PageChange;
end;
procedure TForm1.Chart1PageChange(Sender: TObject);
begin
Chart1.Title.Text.Text:=IntToStr(Chart1.Pages.Current);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |