Heatmap
TsgcHTMLComponent_Heatmap — Delphi, C++ Builder 및 .NET에서 셀 값 또는 바인딩된 데이터셋으로부터 범례와 행/열 레이블을 갖춘 색상 스케일 SVG 히트맵 그리드를 렌더링합니다.
TsgcHTMLComponent_Heatmap — Delphi, C++ Builder 및 .NET에서 셀 값 또는 바인딩된 데이터셋으로부터 범례와 행/열 레이블을 갖춘 색상 스케일 SVG 히트맵 그리드를 렌더링합니다.
행과 열 레이블을 설정하고, SetCell로 셀을 채운(또는 데이터셋을 바인딩한) 다음, HTML 속성을 읽습니다.
TsgcHTMLComponent_Heatmap
인라인 SVG 히트맵 그리드 + 선택적 범례(차트 라이브러리 미사용)
Delphi, C++ Builder, .NET
RowLabels와 ColumnLabels를 채우고, 각 데이터 포인트마다 SetCell(aRow, aCol, aValue)를 호출한(또는 데이터셋을 바인딩한) 다음, 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
가장 자주 사용하게 되는 멤버.
SetCell(aRow, aCol, aValue)는 값 하나를 씁니다. FindCell은 값을 조회하고, ClearData는 Cells 컬렉션을 비웁니다.
RowLabels와 ColumnLabels는 그리드의 각 행과 열의 이름을 지정하는 TStringList입니다.
MinColor/MaxColor/EmptyColor는 셀마다 색상을 혼합합니다. AutoMin/AutoMax는 데이터로부터 스케일링하는 대신 MinValue/MaxValue를 고정합니다.
LoadFromDataSet(aDataSet, aRowField, aColField, aValueField)는 쿼리로부터 곧바로 그리드를 구성합니다.
CellSize/CellGap/Rounded는 셀의 모양을 정합니다. ShowValues/Decimals/FontSize는 표시되는 숫자를 제어합니다.
ShowLegend는 최소값에서 최대값까지의 그라데이션 막대를 그립니다. ShowRowLabels/ShowColumnLabels는 축 텍스트를 켜고 끕니다.