Componente Heatmap — sgcHTML | eSeGeCe

Heatmap

TsgcHTMLComponent_Heatmap — renderiza una cuadrícula de mapa de calor SVG con escala de color a partir de valores de celda o un dataset vinculado, con leyenda y etiquetas de fila/columna, en Delphi, C++ Builder y .NET.

TsgcHTMLComponent_Heatmap

Define las etiquetas de fila y columna, rellena las celdas con SetCell (o vincula un dataset), y luego lee la propiedad HTML.

Clase del componente

TsgcHTMLComponent_Heatmap

Genera

Cuadrícula de mapa de calor SVG en línea + leyenda opcional (sin librería de gráficos)

Lenguajes

Delphi, C++ Builder, .NET

Etiqueta la cuadrícula, rellena las celdas, renderízala

Rellena RowLabels y ColumnLabels, llama a SetCell(aRow, aCol, aValue) para cada dato (o vincula un dataset), y luego lee 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

Propiedades y métodos clave

Los miembros que usarás con más frecuencia.

Celdas

SetCell(aRow, aCol, aValue) escribe un valor; FindCell busca uno y ClearData vacía la colección Cells.

Etiquetas

RowLabels y ColumnLabels son TStringList que nombran cada fila y columna de la cuadrícula.

Escala de color

MinColor/MaxColor/EmptyColor se combinan por celda; AutoMin/AutoMax fijan MinValue/MaxValue en lugar de escalar a partir de los datos.

Vinculación a dataset

LoadFromDataSet(aDataSet, aRowField, aColField, aValueField) construye la cuadrícula directamente desde una consulta.

Presentación de celdas

CellSize/CellGap/Rounded dan forma a las celdas; ShowValues/Decimals/FontSize controlan los números impresos.

Leyenda y etiquetas

ShowLegend dibuja una barra de degradado de mínimo a máximo; ShowRowLabels/ShowColumnLabels activan o desactivan el texto de los ejes.

Sigue explorando

Ayuda en líneaReferencia completa de la API y guía de uso para este componente.
Todos los componentes de sgcHTMLExplora la matriz completa de más de 80 componentes.
Descargar prueba gratuitaLa prueba de 30 días incluye los proyectos de demostración 60.HTML.
PreciosLicencias Single, Team y Site con código fuente completo.

¿Listo para empezar?

Descarga la prueba gratuita y empieza a crear interfaces web en Delphi, C++ Builder y .NET.