TAChart: Implement GetLegendItems for TPolygonSeries.

git-svn-id: trunk@64258 -
This commit is contained in:
wp 2020-12-20 20:31:40 +00:00
parent 94b1982906
commit 7a969539a2

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, Graphics,
TAChartUtils, TADrawUtils, TACustomSeries;
TAChartUtils, TADrawUtils, TACustomSeries, TALegend;
type
TPolygonSeries = class(TBasicPointSeries)
@ -17,6 +17,9 @@ type
FStart: array of Integer;
procedure SetBrush(AValue: TBrush);
procedure SetPen(AValue: TPen);
protected
procedure GetLegendItems(AItems: TChartLegendItems); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -145,6 +148,11 @@ begin
end;
procedure TPolygonSeries.GetLegendItems(AItems: TChartLegendItems);
begin
GetLegendItemsRect(AItems, FBrush, FPen);
end;
{ Is overridden in order to detect tool events inside the polygon (nptCustom).
Otherwise only events on the perimenter would be detected. }
function TPolygonSeries.GetNearestPoint(const AParams: TNearestPointParams;