CandlestickChart コンポーネント — sgcHTML | eSeGeCe

CandlestickChart

TsgcHTMLComponent_CandlestickChart — Delphi、C++ Builder、.NET で、ヒゲ、上昇/下降の色分け、任意の出来高帯を備えた SVG OHLC ローソク足チャートをレンダリングします。

TsgcHTMLComponent_CandlestickChart

AddPoint で 1 本のバーごとに 1 つの OHLC ポイントを追加し(またはデータセットをバインドし)、HTML プロパティを読み取ります。

コンポーネントクラス

TsgcHTMLComponent_CandlestickChart

レンダリング内容

インライン SVG OHLC チャート + 任意の出来高帯(チャートライブラリ不要)

ファミリー

チャート & 可視化

言語

Delphi, C++ Builder, .NET

OHLC ポイントを追加し、レンダリングする

各バーについて 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

主なプロパティとメソッド

最もよく使うメンバーです。

Points

AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) は 1 本の OHLC バーを追加し、TsgcHTMLCandlestickPoint を返します。

Dataset binding

LoadFromDataSet(aDataSet, aDateField, aOpenField, aHighField, aLowField, aCloseField, aVolumeField) は、クエリからシリーズを構築します。

Candle colours

UpColor/DownColor は方向に応じてボディを塗り分け、WickColor は高値安値ラインの色を上書きします。

Volume

ShowVolume は、最も高いバーに合わせてスケーリングされた出来高帯をローソク足の下に追加します。

Axis & grid

ShowAxis/ShowGrid/GridLines/FontSize/Decimals は価格軸を制御します。

Layout & scale

Width/Height/CandleWidth はチャートのサイズを設定し、AutoMin/AutoMax を伴う MinValue/MaxValue は価格範囲を固定します。

さらに詳しく

オンラインヘルプこのコンポーネントの完全な API リファレンスと使用ガイドです。
すべての sgcHTML コンポーネント80 以上のコンポーネントの全機能マトリックスを閲覧できます。
無料体験版のダウンロード30 日間の体験版には 60.HTML デモプロジェクトが付属します。
価格完全なソースコード付きの Single、Team、Site ライセンス。

始める準備はできましたか?

無料体験版をダウンロードして、Delphi、C++ Builder、.NET でローソク足チャートの構築を始めましょう。