mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 08:47:18 +01:00
TAChart: Avoid drawing no candlestick box when open and close prices in a TOpenHighLowCloseSeries are equal.
This commit is contained in:
parent
3ab3101044
commit
12e9db2f31
@ -1832,14 +1832,24 @@ procedure TOpenHighLowCloseSeries.Draw(ADrawer: IChartDrawer);
|
|||||||
ADrawer.Line(MaybeRotate(AX1, AY1), MaybeRotate(AX2, AY2));
|
ADrawer.Line(MaybeRotate(AX1, AY1), MaybeRotate(AX2, AY2));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure NoZeroRect(var R: TRect);
|
||||||
|
begin
|
||||||
|
if IsRotated then
|
||||||
|
begin
|
||||||
|
if R.Left = R.Right then inc(R.Right);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if R.Top = R.Bottom then inc(R.Bottom);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure DoRect(AX1, AY1, AX2, AY2: Double);
|
procedure DoRect(AX1, AY1, AX2, AY2: Double);
|
||||||
var
|
var
|
||||||
r: TRect;
|
r: TRect;
|
||||||
begin
|
begin
|
||||||
with ParentChart do begin
|
r.TopLeft := MaybeRotate(AX1, AY1);
|
||||||
r.TopLeft := MaybeRotate(AX1, AY1);
|
r.BottomRight := MaybeRotate(AX2, AY2);
|
||||||
r.BottomRight := MaybeRotate(AX2, AY2);
|
NoZeroRect(r);
|
||||||
end;
|
|
||||||
ADrawer.FillRect(r.Left, r.Top, r.Right, r.Bottom);
|
ADrawer.FillRect(r.Left, r.Top, r.Right, r.Bottom);
|
||||||
ADrawer.Rectangle(r);
|
ADrawer.Rectangle(r);
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user