mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 12:19:14 +02:00
TAChart: Add TPieSeries.EdgePen property
git-svn-id: trunk@35639 -
This commit is contained in:
parent
911c638917
commit
ab96a7be35
@ -72,10 +72,12 @@ type
|
|||||||
FRadius: Integer;
|
FRadius: Integer;
|
||||||
FSlices: array of TPieSlice;
|
FSlices: array of TPieSlice;
|
||||||
private
|
private
|
||||||
|
FEdgePen: TPen;
|
||||||
FExploded: Boolean;
|
FExploded: Boolean;
|
||||||
FFixedRadius: TChartDistance;
|
FFixedRadius: TChartDistance;
|
||||||
FRotateLabels: Boolean;
|
FRotateLabels: Boolean;
|
||||||
procedure Measure(ADrawer: IChartDrawer);
|
procedure Measure(ADrawer: IChartDrawer);
|
||||||
|
procedure SetEdgePen(AValue: TPen);
|
||||||
procedure SetExploded(AValue: Boolean);
|
procedure SetExploded(AValue: Boolean);
|
||||||
procedure SetFixedRadius(AValue: TChartDistance);
|
procedure SetFixedRadius(AValue: TChartDistance);
|
||||||
procedure SetMarkPositions(AValue: TPieMarkPositions);
|
procedure SetMarkPositions(AValue: TPieMarkPositions);
|
||||||
@ -84,12 +86,16 @@ type
|
|||||||
function TryRadius(ADrawer: IChartDrawer): TRect;
|
function TryRadius(ADrawer: IChartDrawer): TRect;
|
||||||
protected
|
protected
|
||||||
procedure GetLegendItems(AItems: TChartLegendItems); override;
|
procedure GetLegendItems(AItems: TChartLegendItems); override;
|
||||||
|
public
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
public
|
public
|
||||||
function AddPie(AValue: Double; AText: String; AColor: TColor): Integer;
|
function AddPie(AValue: Double; AText: String; AColor: TColor): Integer;
|
||||||
procedure Assign(ASource: TPersistent); override;
|
procedure Assign(ASource: TPersistent); override;
|
||||||
procedure Draw(ADrawer: IChartDrawer); override;
|
procedure Draw(ADrawer: IChartDrawer); override;
|
||||||
function FindContainingSlice(const APoint: TPoint): Integer;
|
function FindContainingSlice(const APoint: TPoint): Integer;
|
||||||
|
|
||||||
|
property EdgePen: TPen read FEdgePen write SetEdgePen;
|
||||||
// Offset slices away from center based on X value.
|
// Offset slices away from center based on X value.
|
||||||
property Exploded: Boolean read FExploded write SetExploded default false;
|
property Exploded: Boolean read FExploded write SetExploded default false;
|
||||||
property FixedRadius: TChartDistance
|
property FixedRadius: TChartDistance
|
||||||
@ -209,6 +215,19 @@ begin
|
|||||||
inherited Assign(ASource);
|
inherited Assign(ASource);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
constructor TCustomPieSeries.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(AOwner);
|
||||||
|
FEdgePen := TPen.Create;
|
||||||
|
FEdgePen.OnChange := @StyleChanged;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCustomPieSeries.Destroy;
|
||||||
|
begin
|
||||||
|
FreeAndNil(FEdgePen);
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomPieSeries.Draw(ADrawer: IChartDrawer);
|
procedure TCustomPieSeries.Draw(ADrawer: IChartDrawer);
|
||||||
const
|
const
|
||||||
STEP = 4;
|
STEP = 4;
|
||||||
@ -224,7 +243,7 @@ begin
|
|||||||
Marks.SetAdditionalAngle(0);
|
Marks.SetAdditionalAngle(0);
|
||||||
Measure(ADrawer);
|
Measure(ADrawer);
|
||||||
|
|
||||||
ADrawer.PrepareSimplePen(clBlack);
|
ADrawer.SetPen(EdgePen);
|
||||||
if Depth > 0 then begin
|
if Depth > 0 then begin
|
||||||
for ps in FSlices do begin
|
for ps in FSlices do begin
|
||||||
if not ps.FVisible then continue;
|
if not ps.FVisible then continue;
|
||||||
@ -339,6 +358,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomPieSeries.SetEdgePen(AValue: TPen);
|
||||||
|
begin
|
||||||
|
if FEdgePen = AValue then exit;
|
||||||
|
FEdgePen.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomPieSeries.SetExploded(AValue: Boolean);
|
procedure TCustomPieSeries.SetExploded(AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if FExploded = AValue then exit;
|
if FExploded = AValue then exit;
|
||||||
@ -574,7 +599,7 @@ end;
|
|||||||
procedure TPolarSeries.SetLinePen(AValue: TPen);
|
procedure TPolarSeries.SetLinePen(AValue: TPen);
|
||||||
begin
|
begin
|
||||||
if FLinePen = AValue then exit;
|
if FLinePen = AValue then exit;
|
||||||
FLinePen := AValue;
|
FLinePen.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPolarSeries.SetOriginX(AValue: Double);
|
procedure TPolarSeries.SetOriginX(AValue: Double);
|
||||||
|
@ -111,6 +111,7 @@ type
|
|||||||
|
|
||||||
TPieSeries = class(TCustomPieSeries)
|
TPieSeries = class(TCustomPieSeries)
|
||||||
published
|
published
|
||||||
|
property EdgePen;
|
||||||
property Depth;
|
property Depth;
|
||||||
property Exploded;
|
property Exploded;
|
||||||
property FixedRadius;
|
property FixedRadius;
|
||||||
|
Loading…
Reference in New Issue
Block a user