mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-09 15:29:42 +01:00
TAChart: Fix bugs in processing of empty extents.
git-svn-id: trunk@20137 -
This commit is contained in:
parent
d8bc38d03f
commit
1421f1836b
@ -1324,11 +1324,17 @@ procedure TChart.UpdateExtent;
|
|||||||
if AUseMax then AHi := AMax;
|
if AUseMax then AHi := AMax;
|
||||||
case Ord(ALo = Infinity) * 2 + Ord(AHi = NegInfinity) of
|
case Ord(ALo = Infinity) * 2 + Ord(AHi = NegInfinity) of
|
||||||
0: begin // Both high and low boundary defined
|
0: begin // Both high and low boundary defined
|
||||||
if ALo > AHi then Exchange(ALo, AHi);
|
if ALo = AHi then begin
|
||||||
// Expand view slightly to avoid puttind data points on the chart edge.
|
ALo -= DEFAULT_WIDTH / 2;
|
||||||
ext := ExpandPercentage * PERCENT * Max(AHi - ALo, 1);
|
AHi += DEFAULT_WIDTH / 2;
|
||||||
ALo -= ext;
|
end
|
||||||
AHi += ext;
|
else begin
|
||||||
|
if ALo > AHi then Exchange(ALo, AHi);
|
||||||
|
// Expand view slightly to avoid data points on the chart edge.
|
||||||
|
ext := ExpandPercentage * PERCENT * Max(AHi - ALo, 1);
|
||||||
|
ALo -= ext;
|
||||||
|
AHi += ext;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
1: AHi := ALo + DEFAULT_WIDTH;
|
1: AHi := ALo + DEFAULT_WIDTH;
|
||||||
2: ALo := AHi - DEFAULT_WIDTH;
|
2: ALo := AHi - DEFAULT_WIDTH;
|
||||||
|
|||||||
@ -1115,7 +1115,7 @@ begin
|
|||||||
Result.b.Y := Max(Result.b.Y, 0);
|
Result.b.Y := Max(Result.b.Y, 0);
|
||||||
// The 0.6 is a hack to allow the bars to have some space apart
|
// The 0.6 is a hack to allow the bars to have some space apart
|
||||||
Result.a.X -= 0.6;
|
Result.a.X -= 0.6;
|
||||||
Result.a.X += 0.6;
|
Result.b.X += 0.6;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBarSeries.GetSeriesColor: TColor;
|
function TBarSeries.GetSeriesColor: TColor;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user