mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:39:31 +02:00
TAChart: Move TLegendItemPieSlice to the TARadialSeries unit
git-svn-id: trunk@31390 -
This commit is contained in:
parent
a6c1d7e971
commit
a29bc6b797
@ -90,13 +90,6 @@ type
|
||||
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
||||
end;
|
||||
|
||||
{ TLegendItemPieSlice }
|
||||
|
||||
TLegendItemPieSlice = class(TLegendItem)
|
||||
public
|
||||
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
||||
end;
|
||||
|
||||
{ TChartLegendItems }
|
||||
|
||||
TChartLegendItems = class(TObjectList)
|
||||
@ -322,23 +315,6 @@ begin
|
||||
ADrawer.Rectangle(ARect);
|
||||
end;
|
||||
|
||||
{ TLegendItemPieSlice }
|
||||
|
||||
procedure TLegendItemPieSlice.Draw(ADrawer: IChartDrawer; const ARect: TRect);
|
||||
const
|
||||
ANGLE = 30 * 16;
|
||||
var
|
||||
bc: TChartColor = clRed;
|
||||
begin
|
||||
inherited Draw(ADrawer, ARect);
|
||||
if Color <> clTAColor then
|
||||
bc := Color;
|
||||
ADrawer.SetBrushParams(bsSolid, bc);
|
||||
ADrawer.RadialPie(
|
||||
2 * ARect.Left - ARect.Right, ARect.Top, ARect.Right, ARect.Bottom,
|
||||
-ANGLE, 2 * ANGLE);
|
||||
end;
|
||||
|
||||
{ TChartLegend }
|
||||
|
||||
procedure TChartLegend.Assign(Source: TPersistent);
|
||||
|
@ -26,6 +26,13 @@ uses
|
||||
TAChartUtils, TACustomSeries, TADrawUtils, TALegend;
|
||||
|
||||
type
|
||||
{ TLegendItemPieSlice }
|
||||
|
||||
TLegendItemPieSlice = class(TLegendItem)
|
||||
public
|
||||
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
||||
end;
|
||||
|
||||
TLabelParams = record
|
||||
FAttachment: TPoint;
|
||||
FCenter: TPoint;
|
||||
@ -120,6 +127,23 @@ uses
|
||||
Math,
|
||||
TACustomSource, TAGeometry, TAGraph;
|
||||
|
||||
{ TLegendItemPieSlice }
|
||||
|
||||
procedure TLegendItemPieSlice.Draw(ADrawer: IChartDrawer; const ARect: TRect);
|
||||
const
|
||||
ANGLE = 30 * 16;
|
||||
var
|
||||
bc: TChartColor = clRed;
|
||||
begin
|
||||
inherited Draw(ADrawer, ARect);
|
||||
if Color <> clTAColor then
|
||||
bc := Color;
|
||||
ADrawer.SetBrushParams(bsSolid, bc);
|
||||
ADrawer.RadialPie(
|
||||
2 * ARect.Left - ARect.Right, ARect.Top, ARect.Right, ARect.Bottom,
|
||||
-ANGLE, 2 * ANGLE);
|
||||
end;
|
||||
|
||||
{ TCustomPieSeries }
|
||||
|
||||
function TCustomPieSeries.AddPie(
|
||||
|
Loading…
Reference in New Issue
Block a user