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) は 1 つの値を書き込みます。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 は軸テキストの表示を切り替えます。