Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2083

Summary: Impossible to display symbols in legend when using series group
Product: VCL TeeChart Reporter: boris.seve
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: normal CC: david
Priority: ---    
Version: 23.171221   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: Modify Chart.pas file

Description boris.seve 2018-09-04 09:49:08 EDT
Created attachment 853 [details]
Modify Chart.pas file

Impossible to display symbols in legend when using series group.

I modify file Chart.pas (attach to that case) to add symbol in legend when using series group.
It is probably not perfect, I will let your team make a better fix for that.
Comment 1 david berneda 2023-03-17 15:33:06 EDT
Using the symbol of the first series in the group is an alternative solution but maybe not what is usually expected.

The aim is to provide some group symbol color or icon property.

A temporary fix now allows using the Symbol.OnDraw event to custom paint the symbol.

With the latest version:

procedure TForm1.PaintSymbol(Sender:TObject; Series:TChartSeries;
                             ValueIndex:Integer; R:TRect);
begin
  // Valueindex is the group index

  Chart1.Canvas.Brush.Color:=clYellow;
  Chart1.Canvas.Rectangle(R);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Legend.Symbol.OnDraw:=PaintSymbol;
end;