Hello,
I've got an issue when using the OnGetAxisLabel.
I've got a couple of TLineSeries, created at runtime, with ParentChart assigned to Chart1 for instance.
Those Series are drawn correctly in Chart1.
But when the Chart1.OnGetAxisLabel(Sender : TChartAxis; Series: TChartSeries; ValueIndex: integer; var LabelText: string) events occur, Series is not assigned and ValueIndex is always equal to -1, whatever the actual position of LabelText.
I want to custom the new LabelText with Series.XValues and ValueIndex, but I failed in connecting the runtime series with the actual Chart axis...
Thanks for any help,
Regards,
Laurent
- Delphi6 / Teechart 7.04 -
Problem with OnGetAxisLabel event
Re: Problem with OnGetAxisLabel event
Hello Laurent,
Maybe the problem is caused because you need set the LabelStyle as Text. The code below works fine for me using latest TeeChart Pro 707:
Hoping this helps you.
Thanks in advance
Maybe the problem is caused because you need set the LabelStyle as Text. The code below works fine for me using latest TeeChart Pro 707:
Code: Select all
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
if valueIndex>-1 then
Caption:= 'ValueInex'+ FloatToStr(valueIndex); //Change that for your code.
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(10);
Chart1.Axes.Bottom.LabelStyle := talText;
end;
Thanks in advance
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Problem with OnGetAxisLabel event
Hello Sandra,
Thank you for your reply.
Actually, my problem came from the fact that the "Series" parameter of the event is not assigned when the event occurs. So calling properties of this local parameter failed.
I solve my problem by using the global Chart1.Series parameter instead of the local 'Series' parameter of the event.
But I'm interested in having information about how the "series" local parameter of the OnGetAxisLabel event works and how it is fed when several series share the same axis?
Thank you again for your help,
Regards,
Laurent
Thank you for your reply.
Actually, my problem came from the fact that the "Series" parameter of the event is not assigned when the event occurs. So calling properties of this local parameter failed.
I solve my problem by using the global Chart1.Series parameter instead of the local 'Series' parameter of the event.
But I'm interested in having information about how the "series" local parameter of the OnGetAxisLabel event works and how it is fed when several series share the same axis?
Thank you again for your help,
Regards,
Laurent
Re: Problem with OnGetAxisLabel event
Hello Laurent,
The OnGetAxisLabel event should be fired with an assigned Series parameter when there are labels in that series and the Axis LabelStyle property is set to talAuto, talText or talMark.lolo1988 wrote:But I'm interested in having information about how the "series" local parameter of the OnGetAxisLabel event works and how it is fed when several series share the same axis?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |