Componente Heatmap — sgcHTML | eSeGeCe

Heatmap

TsgcHTMLComponent_Heatmap — renderize uma grade de heatmap SVG com escala de cores a partir de valores de células ou de um dataset vinculado, com legenda e rótulos de linha/coluna, em Delphi, C++ Builder e .NET.

TsgcHTMLComponent_Heatmap

Defina os rótulos de linha e coluna, preencha as células com SetCell (ou vincule um dataset) e então leia a propriedade HTML.

Classe do componente

TsgcHTMLComponent_Heatmap

Renderiza

Grade de heatmap SVG inline + legenda opcional (sem biblioteca de gráficos)

Linguagens

Delphi, C++ Builder, .NET

Rotule a grade, preencha as células, renderize

Preencha RowLabels e ColumnLabels, chame SetCell(aRow, aCol, aValue) para cada ponto de dado (ou vincule um dataset) e então leia HTML.

uses
  sgcHTML_Component_Heatmap;

var
  oHeatmap: TsgcHTMLComponent_Heatmap;
begin
  oHeatmap := TsgcHTMLComponent_Heatmap.Create(nil);
  try
    oHeatmap.RowLabels.CommaText := 'Mon,Tue,Wed,Thu,Fri';
    oHeatmap.ColumnLabels.CommaText := '9h,12h,15h,18h';
    oHeatmap.ShowLegend := True;
    oHeatmap.ShowValues := True;

    oHeatmap.SetCell(0, 0, 12);
    oHeatmap.SetCell(0, 1, 48);
    oHeatmap.SetCell(1, 2, 76);
    oHeatmap.SetCell(4, 3, 92);

    WebModule.Response := oHeatmap.HTML;   // SVG grid, min->max colour scale
  finally
    oHeatmap.Free;
  end;
end;

// Or bind it straight to a dataset:
oHeatmap.LoadFromDataSet(qryTraffic, 'DayName', 'HourSlot', 'Visits');
// includes: sgcHTML_Component_Heatmap.hpp

TsgcHTMLComponent_Heatmap *oHeatmap = new TsgcHTMLComponent_Heatmap(NULL);
try
{
  oHeatmap->RowLabels->CommaText = "Mon,Tue,Wed,Thu,Fri";
  oHeatmap->ColumnLabels->CommaText = "9h,12h,15h,18h";
  oHeatmap->ShowLegend = true;
  oHeatmap->ShowValues = true;

  oHeatmap->SetCell(0, 0, 12);
  oHeatmap->SetCell(0, 1, 48);
  oHeatmap->SetCell(1, 2, 76);
  oHeatmap->SetCell(4, 3, 92);

  String html = oHeatmap->HTML;   // SVG grid, min->max colour scale
}
__finally
{
  delete oHeatmap;
}
using esegece.sgcWebSockets;

var heatmap = new TsgcHTMLComponent_Heatmap();
heatmap.RowLabels.CommaText = "Mon,Tue,Wed,Thu,Fri";
heatmap.ColumnLabels.CommaText = "9h,12h,15h,18h";
heatmap.ShowLegend = true;
heatmap.ShowValues = true;

heatmap.SetCell(0, 0, 12);
heatmap.SetCell(0, 1, 48);
heatmap.SetCell(1, 2, 76);
heatmap.SetCell(4, 3, 92);

string html = heatmap.HTML;   // SVG grid, min->max colour scale

Principais propriedades & métodos

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

Células

SetCell(aRow, aCol, aValue) grava um valor; FindCell localiza um e ClearData esvazia a coleção Cells.

Rótulos

RowLabels e ColumnLabels são TStringLists que nomeiam cada linha e coluna da grade.

Escala de cores

MinColor/MaxColor/EmptyColor misturam por célula; AutoMin/AutoMax fixam MinValue/MaxValue em vez de escalar a partir dos dados.

Vinculação a dataset

LoadFromDataSet(aDataSet, aRowField, aColField, aValueField) constrói a grade diretamente a partir de uma query.

Exibição da célula

CellSize/CellGap/Rounded moldam as células; ShowValues/Decimals/FontSize controlam os números exibidos.

Legenda & rótulos

ShowLegend desenha uma barra de gradiente de mínimo a máximo; ShowRowLabels/ShowColumnLabels alternam o texto dos eixos.

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.