Page 1 of 1

Problems with Legend in version 2025.44

Posted: Fri Aug 01, 2025 1:39 pm
by 16593577
Hi,
I have several series (TLine) in a chart. After loading the data for series , I specify the series title to be displayed in the legend: Chart.LegendTitle:= 'Filename...';
With version TeeChartVCLFMX-2022.35 it worked without any problems, but after installing 2025.44, it stopped working. Has anything changed, or is this a bug in the new version?

By the way, I think there should be an additional 'lsTitle' entry in the Chart.Legend.LegendStyle property because if there's only one series, you can't set its legend to the title. This only works automatically with at least two series.

Best regards,
Krzysztof Jasek

Re: Problems with Legend in version 2025.44

Posted: Fri Aug 01, 2025 3:50 pm
by 16596842
I see the same issue. This is a bug.

Re: Problems with Legend in version 2025.44

Posted: Mon Aug 04, 2025 7:35 am
by Marc
Hello,

When setting the Series title, default Legend behaviour is to use the Title.

eg.

Code: Select all

series1.Title := 'series title1';
series2.Title := 'series title2';
If there is one series in the Chart, then using Legendstyle forces the series title to be dispplayed, not the value.

eg.

Code: Select all

Chart1.Legend.LegendStyle := TLegendStyle.lsSeries;
Legend Title refers to the title at the top of the Legend that occurs only once but that can be multiline.

eg.

Code: Select all

Chart1.Legend.Title.Text.Add('my Legend Title');
Legend.jpg
Legend.jpg (61.55 KiB) Viewed 4143 times
Regards,
Marc Meumann

Re: Problems with Legend in version 2025.44

Posted: Mon Aug 04, 2025 12:26 pm
by 16596842
There is another bug: if I once hidе a legend using Chart.Legend.Visible:=false; then I show it again, GetLegendText is not called. In the previous version, it was always called after Chart.Legend.Visible:=true;
In the new version, I can no longer re-update the legend elements in the GetLegendText event.

Re: Problems with Legend in version 2025.44

Posted: Thu Aug 07, 2025 9:25 am
by Marc
Hello,

I am not able to reproduce this issue using RAD Studio 12 Version 29.0.55362.2017 and TeeChart Pro v2025.44.

My test code:

Code: Select all

procedure TForm5.Button1Click(Sender: TObject);
begin
  Chart1.Legend.Visible := not Chart1.Legend.Visible;
end;

procedure TForm5.Chart1GetLegendText(Sender: TCustomAxisPanel;
  LegendStyle: TLegendStyle; Index: Integer; var LegendText: string);
begin
     LegendText := LegendText + ' test';
end;
Reactivating the Legend shows the extra text. If you are able to make test project that shows the problem available to us, we'll debug with that.

Regards,
Marc Meumann