mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 10:32:37 +02: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;
|
||||
case Ord(ALo = Infinity) * 2 + Ord(AHi = NegInfinity) of
|
||||
0: begin // Both high and low boundary defined
|
||||
if ALo > AHi then Exchange(ALo, AHi);
|
||||
// Expand view slightly to avoid puttind data points on the chart edge.
|
||||
ext := ExpandPercentage * PERCENT * Max(AHi - ALo, 1);
|
||||
ALo -= ext;
|
||||
AHi += ext;
|
||||
if ALo = AHi then begin
|
||||
ALo -= DEFAULT_WIDTH / 2;
|
||||
AHi += DEFAULT_WIDTH / 2;
|
||||
end
|
||||
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;
|
||||
1: AHi := ALo + DEFAULT_WIDTH;
|
||||
2: ALo := AHi - DEFAULT_WIDTH;
|
||||
|
@ -1115,7 +1115,7 @@ begin
|
||||
Result.b.Y := Max(Result.b.Y, 0);
|
||||
// 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.b.X += 0.6;
|
||||
end;
|
||||
|
||||
function TBarSeries.GetSeriesColor: TColor;
|
||||
|
Loading…
Reference in New Issue
Block a user