mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-26 15:41:36 +01: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;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
|
function AddXOHLC(
|
||||||
|
AX, AOpen, AHigh, ALow, AClose: Double;
|
||||||
|
ALabel: String = ''; AColor: TColor = clTAColor): Integer; inline;
|
||||||
procedure Draw(ADrawer: IChartDrawer); override;
|
procedure Draw(ADrawer: IChartDrawer); override;
|
||||||
function Extent: TDoubleRect; override;
|
function Extent: TDoubleRect; override;
|
||||||
published
|
published
|
||||||
@ -577,6 +580,19 @@ end;
|
|||||||
|
|
||||||
{ TOpenHighLowCloseSeries }
|
{ 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);
|
procedure TOpenHighLowCloseSeries.Assign(ASource: TPersistent);
|
||||||
begin
|
begin
|
||||||
if ASource is TOpenHighLowCloseSeries then
|
if ASource is TOpenHighLowCloseSeries then
|
||||||
@ -601,10 +617,10 @@ begin
|
|||||||
FLinePen := TPen.Create;
|
FLinePen := TPen.Create;
|
||||||
FLinePen.OnChange := @StyleChanged;
|
FLinePen.OnChange := @StyleChanged;
|
||||||
FTickWidth := DEF_OHLC_TICK_WIDTH;
|
FTickWidth := DEF_OHLC_TICK_WIDTH;
|
||||||
FYIndexOpen := DEF_YINDEX_OPEN;
|
|
||||||
FYIndexLow := DEF_YINDEX_LOW;
|
|
||||||
FYIndexHigh := DEF_YINDEX_HIGH;
|
|
||||||
FYIndexClose := DEF_YINDEX_CLOSE;
|
FYIndexClose := DEF_YINDEX_CLOSE;
|
||||||
|
FYIndexHigh := DEF_YINDEX_HIGH;
|
||||||
|
FYIndexLow := DEF_YINDEX_LOW;
|
||||||
|
FYIndexOpen := DEF_YINDEX_OPEN;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TOpenHighLowCloseSeries.Destroy;
|
destructor TOpenHighLowCloseSeries.Destroy;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user