TAChart: Extract TChart.Prepare procedure

git-svn-id: trunk@35887 -
This commit is contained in:
ask 2012-03-11 14:38:41 +00:00
parent 00ebdc2239
commit 6f8724ce64

View File

@ -299,6 +299,7 @@ type
function GetLegendItems(AIncludeHidden: Boolean = false): TChartLegendItems;
procedure PaintOnAuxCanvas(ACanvas: TCanvas; ARect: TRect);
procedure PaintOnCanvas(ACanvas: TCanvas; ARect: TRect);
procedure Prepare;
procedure SaveToBitmapFile(const AFileName: String); inline;
procedure SaveToFile(AClass: TRasterImageClass; AFileName: String);
function SaveToImage(AClass: TRasterImageClass): TRasterImage;
@ -727,8 +728,9 @@ procedure TChart.Draw(ADrawer: IChartDrawer; const ARect: TRect);
var
ldd: TChartLegendDrawingData;
s: TBasicChartSeries;
a: TChartAxis;
begin
Prepare;
ADrawer.DrawingBegin(ARect);
ADrawer.SetAntialiasingMode(AntialiasingMode);
Clear(ADrawer, ARect);
@ -741,16 +743,6 @@ begin
FClipRect.Bottom -= Bottom;
end;
for a in AxisList do
if a.Transformations <> nil then
a.Transformations.SetChart(Self);
for s in Series do
s.BeforeDraw;
if not FIsZoomed then
FLogicalExtent := GetFullExtent;
FCurrentExtent := FLogicalExtent;
with ClipRect do begin;
FTitle.Draw(ADrawer, 1, Left, Right, Top);
FFoot.Draw(ADrawer, -1, Left, Right, Bottom);
@ -1195,6 +1187,22 @@ begin
AxisList.Prepare(FClipRect);
end;
procedure TChart.Prepare;
var
a: TChartAxis;
s: TBasicChartSeries;
begin
for a in AxisList do
if a.Transformations <> nil then
a.Transformations.SetChart(Self);
for s in Series do
s.BeforeDraw;
if not FIsZoomed then
FLogicalExtent := GetFullExtent;
FCurrentExtent := FLogicalExtent;
end;
function TChart.PrepareLegend(
ADrawer: IChartDrawer; var AClipRect: TRect): TChartLegendDrawingData;
begin