TAChart: Fix incorrect extent calculation by TOpenHighLowCloseSeries.

git-svn-id: trunk@56480 -
This commit is contained in:
wp 2017-11-24 08:26:54 +00:00
parent 7060f8549c
commit a7a827f49e

View File

@ -1136,9 +1136,23 @@ end;
function TOpenHighLowCloseSeries.AddXOHLC(
AX, AOpen, AHigh, ALow, AClose: Double;
ALabel: String; AColor: TColor): Integer;
var
y: Double;
begin
if ListSource.YCount < 4 then ListSource.YCount := 4;
Result := ListSource.Add(AX, NaN, ALabel, AColor);
if YIndexOpen = 0 then
y := AOpen
else if YIndexHigh = 0 then
y := AHigh
else if YIndexLow = 0 then
y := ALow
else if YIndexClose = 0 then
y := AClose
else
raise Exception.Create('TOpenHighLowCloseSeries: Ordinary y value missing');
Result := ListSource.Add(AX, y, ALabel, AColor);
with ListSource.Item[Result]^ do begin
SetY(YIndexOpen, AOpen);
SetY(YIndexHigh, AHigh);