mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 10:19:57 +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)
|
TChartSeries = class(TCustomChartSeries)
|
||||||
private
|
private
|
||||||
FBuiltinSource: TCustomChartSource;
|
FBuiltinSource: TCustomChartSource;
|
||||||
|
FLegendMultiplicity: TLegendMultiplicity;
|
||||||
FListener: TListener;
|
FListener: TListener;
|
||||||
FMarks: TChartMarks;
|
FMarks: TChartMarks;
|
||||||
FOnGetMark: TChartGetMarkEvent;
|
FOnGetMark: TChartGetMarkEvent;
|
||||||
@ -102,6 +103,7 @@ type
|
|||||||
|
|
||||||
function GetSource: TCustomChartSource;
|
function GetSource: TCustomChartSource;
|
||||||
function IsSourceStored: boolean;
|
function IsSourceStored: boolean;
|
||||||
|
procedure SetLegendMultiplicity(AValue: TLegendMultiplicity);
|
||||||
procedure SetMarks(const AValue: TChartMarks);
|
procedure SetMarks(const AValue: TChartMarks);
|
||||||
procedure SetOnGetMark(const AValue: TChartGetMarkEvent);
|
procedure SetOnGetMark(const AValue: TChartGetMarkEvent);
|
||||||
procedure SetSource(AValue: TCustomChartSource);
|
procedure SetSource(AValue: TCustomChartSource);
|
||||||
@ -156,6 +158,8 @@ type
|
|||||||
read GetSource write SetSource stored IsSourceStored;
|
read GetSource write SetSource stored IsSourceStored;
|
||||||
published
|
published
|
||||||
property Active default true;
|
property Active default true;
|
||||||
|
property LegendMultiplicity: TLegendMultiplicity
|
||||||
|
read FLegendMultiplicity write SetLegendMultiplicity default lmSingle;
|
||||||
property Marks: TChartMarks read FMarks write SetMarks;
|
property Marks: TChartMarks read FMarks write SetMarks;
|
||||||
property ShowInLegend;
|
property ShowInLegend;
|
||||||
property Title;
|
property Title;
|
||||||
@ -595,6 +599,13 @@ begin
|
|||||||
Source[AIndex]^.Color := AColor;
|
Source[AIndex]^.Color := AColor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChartSeries.SetLegendMultiplicity(AValue: TLegendMultiplicity);
|
||||||
|
begin
|
||||||
|
if FLegendMultiplicity = AValue then exit;
|
||||||
|
FLegendMultiplicity := AValue;
|
||||||
|
UpdateParentChart;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TChartSeries.SetMarks(const AValue: TChartMarks);
|
procedure TChartSeries.SetMarks(const AValue: TChartMarks);
|
||||||
begin
|
begin
|
||||||
if FMarks = AValue then exit;
|
if FMarks = AValue then exit;
|
||||||
|
@ -28,6 +28,8 @@ const
|
|||||||
DEF_LEGEND_SYMBOL_WIDTH = 20;
|
DEF_LEGEND_SYMBOL_WIDTH = 20;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TLegendMultiplicity = (lmSingle, lmPoint);
|
||||||
|
|
||||||
{ TLegendItem }
|
{ TLegendItem }
|
||||||
|
|
||||||
TLegendItem = class
|
TLegendItem = class
|
||||||
|
@ -952,8 +952,13 @@ procedure TPieSeries.GetLegendItems(AItems: TChartLegendItems);
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
case LegendMultiplicity of
|
||||||
|
lmSingle:
|
||||||
|
AItems.Add(TLegendItemColorRect.Create(SliceColor(0), Title));
|
||||||
|
lmPoint:
|
||||||
for i := 0 to Count - 1 do
|
for i := 0 to Count - 1 do
|
||||||
AItems.Add(TLegendItemColorRect.Create(SliceColor(i), FormattedMark(i)));
|
AItems.Add(TLegendItemColorRect.Create(SliceColor(i), FormattedMark(i)));
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPieSeries.SetExploded(const AValue: Boolean);
|
procedure TPieSeries.SetExploded(const AValue: Boolean);
|
||||||
|
Loading…
Reference in New Issue
Block a user