mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-23 08:41:38 +02:00
TAChart: Add TOpenHighLowCloseSeries.AddXOHLC function
git-svn-id: trunk@40176 -
This commit is contained in:
parent
69598aa313
commit
b8182677b8
@ -146,6 +146,9 @@ type
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function AddXOHLC(
|
||||
AX, AOpen, AHigh, ALow, AClose: Double;
|
||||
ALabel: String = ''; AColor: TColor = clTAColor): Integer; inline;
|
||||
procedure Draw(ADrawer: IChartDrawer); override;
|
||||
function Extent: TDoubleRect; override;
|
||||
published
|
||||
@ -577,6 +580,19 @@ end;
|
||||
|
||||
{ TOpenHighLowCloseSeries }
|
||||
|
||||
function TOpenHighLowCloseSeries.AddXOHLC(
|
||||
AX, AOpen, AHigh, ALow, AClose: Double;
|
||||
ALabel: String; AColor: TColor): Integer;
|
||||
begin
|
||||
Result := ListSource.Add(AX, 0, ALabel, AColor);
|
||||
with ListSource.Item[Result]^ do begin
|
||||
SetY(YIndexOpen, AOpen);
|
||||
SetY(YIndexHigh, AHigh);
|
||||
SetY(YIndexLow, ALow);
|
||||
SetY(YIndexClose, AClose);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TOpenHighLowCloseSeries.Assign(ASource: TPersistent);
|
||||
begin
|
||||
if ASource is TOpenHighLowCloseSeries then
|
||||
@ -601,10 +617,10 @@ begin
|
||||
FLinePen := TPen.Create;
|
||||
FLinePen.OnChange := @StyleChanged;
|
||||
FTickWidth := DEF_OHLC_TICK_WIDTH;
|
||||
FYIndexOpen := DEF_YINDEX_OPEN;
|
||||
FYIndexLow := DEF_YINDEX_LOW;
|
||||
FYIndexHigh := DEF_YINDEX_HIGH;
|
||||
FYIndexClose := DEF_YINDEX_CLOSE;
|
||||
FYIndexHigh := DEF_YINDEX_HIGH;
|
||||
FYIndexLow := DEF_YINDEX_LOW;
|
||||
FYIndexOpen := DEF_YINDEX_OPEN;
|
||||
end;
|
||||
|
||||
destructor TOpenHighLowCloseSeries.Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user