Problems with Legend in version 2025.44

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
KJasek
Newbie
Newbie
Posts: 1
Joined: Tue Apr 12, 2022 12:00 am

Problems with Legend in version 2025.44

Post by KJasek » Fri Aug 01, 2025 1:39 pm

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

Newbie
Newbie
Posts: 5
Joined: Mon Oct 09, 2023 12:00 am

Re: Problems with Legend in version 2025.44

Post by » Fri Aug 01, 2025 3:50 pm

I see the same issue. This is a bug.
Last edited by on Mon Aug 04, 2025 12:27 pm, edited 1 time in total.

Marc
Site Admin
Site Admin
Posts: 1341
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Problems with Legend in version 2025.44

Post by Marc » Mon Aug 04, 2025 7:35 am

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 4097 times
Regards,
Marc Meumann
Steema Support

Newbie
Newbie
Posts: 5
Joined: Mon Oct 09, 2023 12:00 am

Re: Problems with Legend in version 2025.44

Post by » Mon Aug 04, 2025 12:26 pm

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.

Marc
Site Admin
Site Admin
Posts: 1341
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Problems with Legend in version 2025.44

Post by Marc » Thu Aug 07, 2025 9:25 am

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
Steema Support

Post Reply