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 - Impossible to display symbols in legend when using series group
Summary: Impossible to display symbols in legend when using series group
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: 23.171221
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-04 09:49 EDT by boris.seve
Modified: 2023-03-17 15:33 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
Modify Chart.pas file (217.35 KB, text/plain)
2018-09-04 09:49 EDT, boris.seve
Details

Note You need to log in before you can comment on or make changes to this bug.
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;