mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 07:37:02 +02:00
TAChart: Initial support for legend multiplicity
git-svn-id: trunk@27557 -
This commit is contained in:
parent
643fc88dfa
commit
84bb112a07
@ -93,6 +93,7 @@ type
|
||||
TChartSeries = class(TCustomChartSeries)
|
||||
private
|
||||
FBuiltinSource: TCustomChartSource;
|
||||
FLegendMultiplicity: TLegendMultiplicity;
|
||||
FListener: TListener;
|
||||
FMarks: TChartMarks;
|
||||
FOnGetMark: TChartGetMarkEvent;
|
||||
@ -102,6 +103,7 @@ type
|
||||
|
||||
function GetSource: TCustomChartSource;
|
||||
function IsSourceStored: boolean;
|
||||
procedure SetLegendMultiplicity(AValue: TLegendMultiplicity);
|
||||
procedure SetMarks(const AValue: TChartMarks);
|
||||
procedure SetOnGetMark(const AValue: TChartGetMarkEvent);
|
||||
procedure SetSource(AValue: TCustomChartSource);
|
||||
@ -156,6 +158,8 @@ type
|
||||
read GetSource write SetSource stored IsSourceStored;
|
||||
published
|
||||
property Active default true;
|
||||
property LegendMultiplicity: TLegendMultiplicity
|
||||
read FLegendMultiplicity write SetLegendMultiplicity default lmSingle;
|
||||
property Marks: TChartMarks read FMarks write SetMarks;
|
||||
property ShowInLegend;
|
||||
property Title;
|
||||
@ -595,6 +599,13 @@ begin
|
||||
Source[AIndex]^.Color := AColor;
|
||||
end;
|
||||
|
||||
procedure TChartSeries.SetLegendMultiplicity(AValue: TLegendMultiplicity);
|
||||
begin
|
||||
if FLegendMultiplicity = AValue then exit;
|
||||
FLegendMultiplicity := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
procedure TChartSeries.SetMarks(const AValue: TChartMarks);
|
||||
begin
|
||||
if FMarks = AValue then exit;
|
||||
|
@ -28,6 +28,8 @@ const
|
||||
DEF_LEGEND_SYMBOL_WIDTH = 20;
|
||||
|
||||
type
|
||||
TLegendMultiplicity = (lmSingle, lmPoint);
|
||||
|
||||
{ TLegendItem }
|
||||
|
||||
TLegendItem = class
|
||||
|
@ -952,8 +952,13 @@ procedure TPieSeries.GetLegendItems(AItems: TChartLegendItems);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Count - 1 do
|
||||
AItems.Add(TLegendItemColorRect.Create(SliceColor(i), FormattedMark(i)));
|
||||
case LegendMultiplicity of
|
||||
lmSingle:
|
||||
AItems.Add(TLegendItemColorRect.Create(SliceColor(0), Title));
|
||||
lmPoint:
|
||||
for i := 0 to Count - 1 do
|
||||
AItems.Add(TLegendItemColorRect.Create(SliceColor(i), FormattedMark(i)));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPieSeries.SetExploded(const AValue: Boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user