Legend title exceeds legend box

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Oppi
Newbie
Newbie
Posts: 12
Joined: Thu May 27, 2004 4:00 am

Legend title exceeds legend box

Post by Oppi » Fri Sep 02, 2005 11:55 am

Hi,

we encountered the following problem with Teechart 7.03:

The size of the chart legend box is set via the length of a series title and not via the legend title itself. Is it a known issue and how can we work around it?

Best regards

Arnd

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 Sep 02, 2005 2:56 pm

Hi Arnd,

Yes, this is as-designed. If you don't want the legend to behave like that you can use any of the following solutions:

Code: Select all

procedure TForm1.Chart1GetLegendText(Sender: TCustomAxisPanel;
  LegendStyle: TLegendStyle; Index: Integer; var LegendText: String);
begin
  if Length(LegendText)>20 then
    LegendText:='Series'+IntToStr(Index+1);
end;

Code: Select all

procedure TForm1.Chart1GetLegendRect(Sender: TCustomChart;
  var Rect: TRect);
begin
  Rect.Right:=Rect.Right-20;
end;
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

Post Reply