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 — renderizza un grafico a candele OHLC in SVG con stoppini, colori rialzo/ribasso e una fascia volume opzionale, in Delphi, C++ Builder e .NET.
Aggiungi un punto OHLC per ogni barra con AddPoint (oppure collega un dataset), quindi leggi la proprietà HTML.
TsgcHTMLComponent_CandlestickChart
Inline SVG OHLC chart + optional volume strip (no chart library)
Delphi, C++ Builder, .NET
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
I membri che utilizzerai più spesso.
AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) aggiunge una barra OHLC e restituisce il TsgcHTMLCandlestickPoint.
LoadFromDataSet(aDataSet, aDateField, aOpenField, aHighField, aLowField, aCloseField, aVolumeField) costruisce la serie da una query.
UpColor/DownColor colorano il corpo in base alla direzione; WickColor sovrascrive il colore della linea high-low.
ShowVolume aggiunge una fascia volume sotto le candele, scalata sulla barra più alta.
ShowAxis/ShowGrid/GridLines/FontSize/Decimals controllano l’asse dei prezzi.
Width/Height/CandleWidth dimensionano il grafico; MinValue/MaxValue con AutoMin/AutoMax fissano l’intervallo dei prezzi.
| Guida in lineaRiferimento API completo e guida all’uso per questo componente. | Apri | |
| Tutti i componenti sgcHTMLEsplora la matrice completa delle funzionalità di oltre 80 componenti. | Apri | |
| Scarica la Prova GratuitaLa prova di 30 giorni include i progetti demo 60.HTML. | Apri | |
| PrezziLicenze Single, Team e Site con codice sorgente completo. | Apri |