mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 02:33:38 +02:00
TAChart: Fix extent of side-by-side bar series being calculated incorrectly if an x axis transformation is active.
git-svn-id: trunk@53904 -
This commit is contained in:
parent
f9244f936d
commit
2dd33ce583
@ -1090,16 +1090,18 @@ begin
|
|||||||
UpdateMinMax(ZeroLevel, Result.a.Y, Result.b.Y);
|
UpdateMinMax(ZeroLevel, Result.a.Y, Result.b.Y);
|
||||||
// Show first and last bars fully.
|
// Show first and last bars fully.
|
||||||
i := 0;
|
i := 0;
|
||||||
x := NearestXNumber(i, +1);
|
x := NearestXNumber(i, +1); // --> x is in graph units
|
||||||
if not IsNan(x) then begin
|
if not IsNan(x) then begin
|
||||||
BarOffsetWidth(x, i, ofs, w);
|
BarOffsetWidth(x, i, ofs, w);
|
||||||
Result.a.X := Min(Result.a.X, x + ofs - w);
|
x := GraphToAxisX(x + ofs - w); // x is in graph units, Extent in axis units!
|
||||||
|
Result.a.X := Min(Result.a.X, x);
|
||||||
end;
|
end;
|
||||||
i := Count - 1;
|
i := Count - 1;
|
||||||
x := NearestXNumber(i, -1);
|
x := NearestXNumber(i, -1);
|
||||||
if not IsNan(x) then begin
|
if not IsNan(x) then begin
|
||||||
BarOffsetWidth(x, i, ofs, w);
|
BarOffsetWidth(x, i, ofs, w);
|
||||||
Result.b.X := Max(Result.b.X, x + ofs + w);
|
x := GraphToAxisX(x + ofs + w);
|
||||||
|
Result.b.X := Max(Result.b.X, x);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user