I have set the following code but the function never gets called, is there an alternative?
Chart1.OnGetAxisLabel := Chart1GetAxisLabel;
Chart possible with Teechart?
Re: Chart possible with Teechart?
Hello,
As soon as there's a series with data in the chart, it should be called. Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
As soon as there's a series with data in the chart, it should be called. Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Chart possible with Teechart?
Apologies for the late reply (was away for 2 weeks). I tried it out in a smaller program and the event-handler is called, hence must be a problem in my code.
Thanks for all the help.
Thanks for all the help.
Re: Chart possible with Teechart?
Hello,
Sorry, I forgot to mention the OnGetAxisLabel isn't fired for an axis when you set it with custom labels. In this case you already control what texts are drawn and at what positions so you shouldn't need the event.
Sorry, I forgot to mention the OnGetAxisLabel isn't fired for an axis when you set it with custom labels. In this case you already control what texts are drawn and at what positions so you shouldn't need the event.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Chart possible with Teechart?
Thanks for the additional feedback.
Re: Chart possible with Teechart?
For the text being shown in a shape, is there a way to wrap it in case it doesn't fit into a rectangle?
Re: Chart possible with Teechart?
Hello,
Instead of formatting the texts with sLineBreak as I do at GetText function, you could use wraptext function once the chart has been drawn. Ie, at the end of your FormCreate:
Instead of formatting the texts with sLineBreak as I do at GetText function, you could use wraptext function once the chart has been drawn. Ie, at the end of your FormCreate:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var textW, shapeW: Integer;
begin
//...
Chart1.Draw;
for i:=0 to Chart1.SeriesCount-1 do
with Chart1[i] as TChartShape do
begin
Chart1.Canvas.AssignFont3D(Font);
textW:=Chart1.Canvas.TextWidth(Text.Text);
shapeW:=Bounds.Right-Bounds.Left;
if textW>shapeW then
begin
charW:=Chart1.Canvas.TextWidth('W');
Text.Text:=WrapText(Text.Text, shapeW div charW);
end;
end;
Chart1.Draw;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Chart possible with Teechart?
Thanks for the additional help.