TAChart: Move TLegendItemPieSlice to the TARadialSeries unit

git-svn-id: trunk@31390 -
This commit is contained in:
ask 2011-06-26 06:15:32 +00:00
parent a6c1d7e971
commit a29bc6b797
2 changed files with 24 additions and 24 deletions

View File

@ -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);

View File

@ -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(