TAChart: Auto-hide axis if exception is raised while drawing it

git-svn-id: trunk@32027 -
This commit is contained in:
ask 2011-08-21 10:06:43 +00:00
parent afcfb37496
commit b001e5e50e

View File

@ -836,8 +836,13 @@ begin
while AIndex < FZOrder.Count do while AIndex < FZOrder.Count do
with TChartAxis(FZOrder[AIndex]) do begin with TChartAxis(FZOrder[AIndex]) do begin
if ACurrentZ < ZPosition then break; if ACurrentZ < ZPosition then break;
try
Draw; Draw;
DrawTitle(FCenterPoint, FGroups[FGroupIndex].FTitleSize); DrawTitle(FCenterPoint, FGroups[FGroupIndex].FTitleSize);
except
Visible := false;
raise;
end;
AIndex += 1; AIndex += 1;
end; end;
end; end;
@ -899,7 +904,12 @@ begin
g^.FTitleSize := 0; g^.FTitleSize := 0;
for j := 0 to g^.FCount - 1 do begin for j := 0 to g^.FCount - 1 do begin
axis := TChartAxis(FGroupOrder[ai]); axis := TChartAxis(FGroupOrder[ai]);
try
axis.Measure(AExtent, g^); axis.Measure(AExtent, g^);
except
axis.Visible := false;
raise;
end;
ai += 1; ai += 1;
end; end;
// Axises of the same group should have the same Alignment and ZPosition. // Axises of the same group should have the same Alignment and ZPosition.