Heatmap Component — sgcHTML | eSeGeCe

Heatmap

TsgcHTMLComponent_Heatmap — renderizza una griglia heatmap SVG a scala di colore da valori di cella o da un dataset associato, con legenda ed etichette di riga/colonna, in Delphi, C++ Builder e .NET.

TsgcHTMLComponent_Heatmap

Imposta le etichette di riga e colonna, riempi le celle con SetCell (oppure collega un dataset), quindi leggi la proprietà HTML.

Classe del componente

TsgcHTMLComponent_Heatmap

Renderizza

Inline SVG heatmap grid + optional legend (no chart library)

Linguaggi

Delphi, C++ Builder, .NET

Etichetta la griglia, riempi le celle, renderizzala

Popola RowLabels e ColumnLabels, chiama SetCell(aRow, aCol, aValue) per ogni punto dati (oppure collega un dataset), quindi leggi 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

Proprietà e metodi principali

I membri che utilizzerai più spesso.

Celle

SetCell(aRow, aCol, aValue) scrive un valore; FindCell ne cerca uno e ClearData svuota la collezione Cells.

Etichette

RowLabels e ColumnLabels sono TStringList che assegnano un nome a ciascuna riga e colonna della griglia.

Scala colori

MinColor/MaxColor/EmptyColor si fondono per cella; AutoMin/AutoMax fissano MinValue/MaxValue invece di calcolarli dai dati.

Binding ai dataset

LoadFromDataSet(aDataSet, aRowField, aColField, aValueField) costruisce la griglia direttamente da una query.

Visualizzazione celle

CellSize/CellGap/Rounded definiscono la forma delle celle; ShowValues/Decimals/FontSize controllano i numeri stampati.

Legenda ed etichette

ShowLegend disegna una barra a gradiente dal minimo al massimo; ShowRowLabels/ShowColumnLabels attivano o disattivano il testo degli assi.

Continua a esplorare

Guida in lineaRiferimento API completo e guida all’uso per questo componente.
Tutti i componenti sgcHTMLEsplora la matrice completa delle funzionalità di oltre 80 componenti.
Scarica la Prova GratuitaLa prova di 30 giorni include i progetti demo 60.HTML.
PrezziLicenze Single, Team e Site con codice sorgente completo.

Pronto a Iniziare?

Scarica la versione di prova gratuita e inizia a creare interfacce web in Delphi, C++ Builder e .NET.