CandlestickChart Component — sgcHTML | eSeGeCe

CandlestickChart

TsgcHTMLComponent_CandlestickChart — renderizza un grafico a candele OHLC in SVG con stoppini, colori rialzo/ribasso e una fascia volume opzionale, in Delphi, C++ Builder e .NET.

TsgcHTMLComponent_CandlestickChart

Aggiungi un punto OHLC per ogni barra con AddPoint (oppure collega un dataset), quindi leggi la proprietà HTML.

Classe del componente

TsgcHTMLComponent_CandlestickChart

Renderizza

Inline SVG OHLC chart + optional volume strip (no chart library)

Linguaggi

Delphi, C++ Builder, .NET

Aggiungi i punti OHLC, renderizzalo

Chiama AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) per ogni barra (oppure collega un dataset), quindi leggi 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

Proprietà e metodi principali

I membri che utilizzerai più spesso.

Punti

AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) aggiunge una barra OHLC e restituisce il TsgcHTMLCandlestickPoint.

Binding ai dataset

LoadFromDataSet(aDataSet, aDateField, aOpenField, aHighField, aLowField, aCloseField, aVolumeField) costruisce la serie da una query.

Colori delle candele

UpColor/DownColor colorano il corpo in base alla direzione; WickColor sovrascrive il colore della linea high-low.

Volume

ShowVolume aggiunge una fascia volume sotto le candele, scalata sulla barra più alta.

Asse e griglia

ShowAxis/ShowGrid/GridLines/FontSize/Decimals controllano l’asse dei prezzi.

Layout e scala

Width/Height/CandleWidth dimensionano il grafico; MinValue/MaxValue con AutoMin/AutoMax fissano l’intervallo dei prezzi.

Continua a esplorare

Guida in lineaRiferimento API completo e guida all’uso per questo componente.
Tutti i componenti sgcHTMLEsplora la matrice completa delle funzionalità di oltre 80 componenti.
Scarica la Prova GratuitaLa prova di 30 giorni include i progetti demo 60.HTML.
PrezziLicenze Single, Team e Site con codice sorgente completo.

Pronto a Iniziare?

Scarica la versione di prova gratuita e inizia a creare interfacce web in Delphi, C++ Builder e .NET.