mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 20:21:12 +02:00
TAChart: Provide public method TPieSeries.CalcBorderPoint.
git-svn-id: trunk@60752 -
This commit is contained in:
parent
1b480c8800
commit
0c7f82169d
@ -126,6 +126,7 @@ type
|
|||||||
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;
|
||||||
|
function CalcBorderPoint(ASlice: TPieSlice; ARadius, AAngle: Double): TPoint; inline;
|
||||||
function CalcInnerRadius: Integer; inline;
|
function CalcInnerRadius: Integer; inline;
|
||||||
procedure Draw(ADrawer: IChartDrawer); override;
|
procedure Draw(ADrawer: IChartDrawer); override;
|
||||||
function FindContainingSlice(const APoint: TPoint): Integer;
|
function FindContainingSlice(const APoint: TPoint): Integer;
|
||||||
@ -318,6 +319,12 @@ begin
|
|||||||
inherited Assign(ASource);
|
inherited Assign(ASource);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomPieSeries.CalcBorderPoint(ASlice: TPieSlice;
|
||||||
|
ARadius, AAngle: Double): TPoint;
|
||||||
|
begin
|
||||||
|
result := ASlice.FBase + FixAspectRatio(RotatePointX(ARadius, -AAngle));
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomPieSeries.CalcInnerRadius: Integer;
|
function TCustomPieSeries.CalcInnerRadius: Integer;
|
||||||
begin
|
begin
|
||||||
Result := Round(0.01 * FRadius * FInnerRadiusPercent);
|
Result := Round(0.01 * FRadius * FInnerRadiusPercent);
|
||||||
@ -431,7 +438,7 @@ var
|
|||||||
end;
|
end;
|
||||||
for i := 0 to n - 1 do begin
|
for i := 0 to n - 1 do begin
|
||||||
a := WeightedAverage(Angle1, Angle2, i / (n - 1));
|
a := WeightedAverage(Angle1, Angle2, i / (n - 1));
|
||||||
APoints[j] := ASlice.FBase + FixAspectRatio(RotatePointX(ARadius, -a));
|
APoints[j] := CalcBorderpoint(ASlice, ARadius, a);
|
||||||
inc(j, dj);
|
inc(j, dj);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user