Componente CandlestickChart — sgcHTML | eSeGeCe

CandlestickChart

TsgcHTMLComponent_CandlestickChart — renderize um gráfico de candlestick OHLC em SVG com pavios, cores de alta/baixa e uma faixa de volume opcional, em Delphi, C++ Builder e .NET.

TsgcHTMLComponent_CandlestickChart

Adicione um ponto OHLC por barra com AddPoint (ou vincule um dataset) e então leia a propriedade HTML.

Classe do componente

TsgcHTMLComponent_CandlestickChart

Renderiza

Gráfico OHLC SVG inline + faixa de volume opcional (sem biblioteca de gráficos)

Linguagens

Delphi, C++ Builder, .NET

Adicione pontos OHLC, renderize

Chame AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) para cada barra (ou vincule um dataset) e então leia 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

Principais propriedades & métodos

Os membros que você usa com mais frequência.

Pontos

AddPoint(aLabel, aOpen, aHigh, aLow, aClose, aVolume) adiciona uma barra OHLC e retorna o TsgcHTMLCandlestickPoint.

Vinculação a dataset

LoadFromDataSet(aDataSet, aDateField, aOpenField, aHighField, aLowField, aCloseField, aVolumeField) constrói a série a partir de uma query.

Cores dos candles

UpColor/DownColor pintam o corpo conforme a direção; WickColor substitui a cor da linha de máxima/mínima.

Volume

ShowVolume adiciona uma faixa de volume abaixo dos candles, escalada pela barra mais alta.

Eixo & grade

ShowAxis/ShowGrid/GridLines/FontSize/Decimals controlam o eixo de preço.

Layout & escala

Width/Height/CandleWidth dimensionam o gráfico; MinValue/MaxValue com AutoMin/AutoMax fixam o intervalo de preço.

Continue explorando

Ajuda onlineReferência completa da API e guia de uso para este componente.
Todos os Componentes sgcHTMLExplore a matriz completa de recursos com mais de 80 componentes.
Baixar Versão de Avaliação GratuitaA avaliação de 30 dias inclui os projetos de demonstração 60.HTML.
PreçosLicenças Single, Team e Site com código-fonte completo.

Pronto para Começar?

Baixe a versão de avaliação gratuita e comece a construir UIs web em Delphi, C++ Builder e .NET.