CandlestickChart
TsgcHTMLComponent_CandlestickChart — render an SVG OHLC candlestick chart with wicks, up/down colours and an optional volume strip, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_CandlestickChart — render an SVG OHLC candlestick chart with wicks, up/down colours and an optional volume strip, in Delphi, C++ Builder and .NET.
Add one OHLC point per bar with AddPoint (or bind a dataset), then read the HTML property.
TsgcHTMLComponent_CandlestickChart
Inline SVG OHLC chart + optional volume strip (no chart library)
Delphi, C++ Builder, .NET
Call AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) for each bar (or bind a dataset), then read 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
The members you reach for most often.
AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) appends one OHLC bar and returns the TsgcHTMLCandlestickPoint.
LoadFromDataSet(aDataSet, aDateField, aOpenField, aHighField, aLowField, aCloseField, aVolumeField) builds the series from a query.
UpColor/DownColor paint the body by direction; WickColor overrides the high-low line colour.
ShowVolume adds a volume strip below the candles, scaled to the highest bar.
ShowAxis/ShowGrid/GridLines/FontSize/Decimals control the price axis.
Width/Height/CandleWidth size the chart; MinValue/MaxValue with AutoMin/AutoMax pin the price range.
| Online HelpFull API reference and usage guide for this component. | Open | |
| All sgcHTML ComponentsBrowse the full feature matrix of 80+ components. | Open | |
| Download Free TrialThe 30-day trial ships the 60.HTML demo projects. | Open | |
| PricingSingle, Team and Site licenses with full source code. | Open |