mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 07:55:58 +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;
|
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TLegendItemPieSlice }
|
|
||||||
|
|
||||||
TLegendItemPieSlice = class(TLegendItem)
|
|
||||||
public
|
|
||||||
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TChartLegendItems }
|
{ TChartLegendItems }
|
||||||
|
|
||||||
TChartLegendItems = class(TObjectList)
|
TChartLegendItems = class(TObjectList)
|
||||||
@ -322,23 +315,6 @@ begin
|
|||||||
ADrawer.Rectangle(ARect);
|
ADrawer.Rectangle(ARect);
|
||||||
end;
|
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 }
|
{ TChartLegend }
|
||||||
|
|
||||||
procedure TChartLegend.Assign(Source: TPersistent);
|
procedure TChartLegend.Assign(Source: TPersistent);
|
||||||
|
@ -26,6 +26,13 @@ uses
|
|||||||
TAChartUtils, TACustomSeries, TADrawUtils, TALegend;
|
TAChartUtils, TACustomSeries, TADrawUtils, TALegend;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
{ TLegendItemPieSlice }
|
||||||
|
|
||||||
|
TLegendItemPieSlice = class(TLegendItem)
|
||||||
|
public
|
||||||
|
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
||||||
|
end;
|
||||||
|
|
||||||
TLabelParams = record
|
TLabelParams = record
|
||||||
FAttachment: TPoint;
|
FAttachment: TPoint;
|
||||||
FCenter: TPoint;
|
FCenter: TPoint;
|
||||||
@ -120,6 +127,23 @@ uses
|
|||||||
Math,
|
Math,
|
||||||
TACustomSource, TAGeometry, TAGraph;
|
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 }
|
{ TCustomPieSeries }
|
||||||
|
|
||||||
function TCustomPieSeries.AddPie(
|
function TCustomPieSeries.AddPie(
|
||||||
|
Loading…
Reference in New Issue
Block a user