CandlestickChart
TsgcHTMLComponent_CandlestickChart — Delphi、C++ Builder、.NET で、ヒゲ、上昇/下降の色分け、任意の出来高帯を備えた SVG OHLC ローソク足チャートをレンダリングします。
TsgcHTMLComponent_CandlestickChart — Delphi、C++ Builder、.NET で、ヒゲ、上昇/下降の色分け、任意の出来高帯を備えた SVG OHLC ローソク足チャートをレンダリングします。
AddPoint で 1 本のバーごとに 1 つの OHLC ポイントを追加し(またはデータセットをバインドし)、HTML プロパティを読み取ります。
TsgcHTMLComponent_CandlestickChart
インライン SVG OHLC チャート + 任意の出来高帯(チャートライブラリ不要)
Delphi, C++ Builder, .NET
各バーについて AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) を呼び出し(またはデータセットをバインドし)、HTML を読み取ります。
uses
sgcHTML_Component_CandlestickChart;
var
oChart: TsgcHTMLComponent_CandlestickChart;
begin
oChart := TsgcHTMLComponent_CandlestickChart.Create(nil);
try
oChart.Width := 800;
oChart.Height := 400;
oChart.ShowVolume := True;
oChart.AddPoint('Mon', 101.2, 104.8, 100.1, 103.5, 125000);
oChart.AddPoint('Tue', 103.5, 106.0, 102.8, 105.1, 98000);
oChart.AddPoint('Wed', 105.1, 105.4, 101.0, 101.9, 154000);
WebModule.Response := oChart.HTML; // SVG candles + wicks + volume strip
finally
oChart.Free;
end;
end;
// Or bind it straight to a dataset:
oChart.LoadFromDataSet(qryOHLC, 'TradeDate', 'OpenPrice', 'HighPrice',
'LowPrice', 'ClosePrice', 'Volume');
// includes: sgcHTML_Component_CandlestickChart.hpp
TsgcHTMLComponent_CandlestickChart *oChart = new TsgcHTMLComponent_CandlestickChart(NULL);
try
{
oChart->Width = 800;
oChart->Height = 400;
oChart->ShowVolume = true;
oChart->AddPoint("Mon", 101.2, 104.8, 100.1, 103.5, 125000);
oChart->AddPoint("Tue", 103.5, 106.0, 102.8, 105.1, 98000);
oChart->AddPoint("Wed", 105.1, 105.4, 101.0, 101.9, 154000);
String html = oChart->HTML; // SVG candles + wicks + volume strip
}
__finally
{
delete oChart;
}
using esegece.sgcWebSockets;
var chart = new TsgcHTMLComponent_CandlestickChart();
chart.Width = 800;
chart.Height = 400;
chart.ShowVolume = true;
chart.AddPoint("Mon", 101.2, 104.8, 100.1, 103.5, 125000);
chart.AddPoint("Tue", 103.5, 106.0, 102.8, 105.1, 98000);
chart.AddPoint("Wed", 105.1, 105.4, 101.0, 101.9, 154000);
string html = chart.HTML; // SVG candles + wicks + volume strip
最もよく使うメンバーです。
AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) は 1 本の OHLC バーを追加し、TsgcHTMLCandlestickPoint を返します。
LoadFromDataSet(aDataSet, aDateField, aOpenField, aHighField, aLowField, aCloseField, aVolumeField) は、クエリからシリーズを構築します。
UpColor/DownColor は方向に応じてボディを塗り分け、WickColor は高値安値ラインの色を上書きします。
ShowVolume は、最も高いバーに合わせてスケーリングされた出来高帯をローソク足の下に追加します。
ShowAxis/ShowGrid/GridLines/FontSize/Decimals は価格軸を制御します。
Width/Height/CandleWidth はチャートのサイズを設定し、AutoMin/AutoMax を伴う MinValue/MaxValue は価格範囲を固定します。