Page 1 of 1

Legend title exceeds legend box

Posted: Fri Sep 02, 2005 11:55 am
by 9337635
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

Posted: Fri Sep 02, 2005 2:56 pm
by narcis
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;