TAChart: Support Marks.Attachment = maCenter in pie series

git-svn-id: trunk@38675 -
This commit is contained in:
ask 2012-09-16 04:14:00 +00:00
parent 951b26f892
commit a35e517060

View File

@ -441,7 +441,10 @@ function TCustomPieSeries.TryRadius(ADrawer: IChartDrawer): TRect;
end;
b := a;
end;
Result := Norm([tmin * ca, tmin * sa]);
if tmin = ALMOST_INF then // Should never happen.
Result := 0
else
Result := Norm([tmin * ca, tmin * sa]);
end;
procedure PrepareLabel(
@ -451,8 +454,13 @@ function TCustomPieSeries.TryRadius(ADrawer: IChartDrawer): TRect;
p: TPointArray;
function Ofs(AAngle: Double): TPoint;
var
d: Double;
begin
Result := EndPoint(AAngle, Marks.Distance + LabelExtraDist(p, AAngle));
d := Marks.Distance;
if not Marks.DistanceToCenter then
d += LabelExtraDist(p, AAngle);
Result := EndPoint(AAngle, d);
end;
begin