Legend.Style=lsLastValues does not work since last release

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
SStol
Newbie
Newbie
Posts: 1
Joined: Tue Oct 19, 2021 12:00 am

Legend.Style=lsLastValues does not work since last release

Post by SStol » Wed Jun 25, 2025 2:50 pm

Since last release (2025.44.250520) Legend.Style=lsLastValues does not work properly.

Please see minimal example in attachment...

old version:
_old.jpg
_old.jpg (65.93 KiB) Viewed 603 times
new version:
_new.jpg
_new.jpg (67.41 KiB) Viewed 603 times
Regards,
Attachments
Steema.LastValues.Exploit.zip
minimal example
(6.38 KiB) Downloaded 13 times

Yeray
Site Admin
Site Admin
Posts: 9709
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Legend.Style=lsLastValues does not work since last release

Post by Yeray » Thu Jun 26, 2025 8:18 am

Hello,

Yes, that was bug in v2025.44, which was identified and fixed here.
Find below the full git diff:

Code: Select all

--- a/Chart.pas
+++ b/Chart.pas
@@ -418,6 +418,7 @@ type

     ILegend : TCustomChartLegend;

+    procedure FontChanged(Sender: TObject);
     function GetFont:TTeeFont;
     procedure SetAlign(const Value:TCanvasTextAlign);
     procedure SetCustom(SetPos:Boolean);
@@ -5519,6 +5520,14 @@ begin
   result:=Assigned(FFont);
 end;

+procedure TLegendItem.FontChanged(Sender: TObject);
+begin
+  SetCustom(False);
+
+  if Assigned(ILegend) then
+    ILegend.CanvasChanged(Sender);
+end;
+
 function TLegendItem.GetFont:TTeeFont;
 var Old : Boolean;
 begin
@@ -5536,6 +5545,12 @@ begin
      else
         FFont:=TTeeFont.Create(nil);

+  {$IFDEF FMX}
+  FFont.Brush.OnChanged:=FontChanged;
+  {$ELSE}
+  FFont.OnChange:=FontChanged;
+  {$ENDIF}
+
   result:=FFont;
 end;

@@ -5635,11 +5650,6 @@ begin
     result:=TLegendItem.Create;
     result.ILegend:=ILegend;

-    if ILegend.InternalLegendStyle=lsAuto then
-       ILegend.CalcLegendStyle;
-
-    result.Text:=ILegend.FormattedLegend(Index);
-
     inherited Items[Index]:=result;
   end;
 end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply