StatCard
TsgcHTMLComponent_StatCard — Delphi、C++ Builder、.NET で、アイコン、トレンド矢印、任意のグラデーション背景を備えたダッシュボード KPI/統計カードをレンダリングします。
TsgcHTMLComponent_StatCard — Delphi、C++ Builder、.NET で、アイコン、トレンド矢印、任意のグラデーション背景を備えたダッシュボード KPI/統計カードをレンダリングします。
Bootstrap の card 上に構築された指標タイルです。タイトルと値を設定し、アイコンとトレンドを追加し、任意でグラデーションを適用してから、HTML プロパティを読み取ります。
TsgcHTMLComponent_StatCard
Bootstrap 5 の card マークアップ
Delphi, C++ Builder, .NET
Title と Value を割り当て、Color と Trend、任意で Gradient を選択してから、HTML を読み取ります — または、静的な一行の Build ヘルパーを使用します。
uses
sgcHTML_Component_StatCard;
var
oStat: TsgcHTMLComponent_StatCard;
begin
oStat := TsgcHTMLComponent_StatCard.Create(nil);
try
oStat.Title := 'Monthly Revenue';
oStat.Value := '$48,200';
oStat.Icon := '●';
oStat.Color := scSuccess;
oStat.Trend := stUp;
oStat.TrendValue := '12.5%';
WebModule.Response := oStat.HTML; // Bootstrap card
finally
oStat.Free;
end;
end;
// Or in a single line with the static helper:
Result := TsgcHTMLComponent_StatCard.Build('Monthly Revenue', '$48,200',
scSuccess, stUp, '12.5%', 'kpiRevenue', sgBlueViolet);
// includes: sgcHTML_Component_StatCard.hpp
TsgcHTMLComponent_StatCard *oStat = new TsgcHTMLComponent_StatCard(NULL);
try
{
oStat->Title = "Monthly Revenue";
oStat->Value = "$48,200";
oStat->Icon = "●";
oStat->Color = scSuccess;
oStat->Trend = stUp;
oStat->TrendValue = "12.5%";
String html = oStat->HTML; // Bootstrap card
}
__finally
{
delete oStat;
}
// Or in a single line with the static helper:
String html = TsgcHTMLComponent_StatCard::Build("Monthly Revenue", "$48,200",
scSuccess, stUp, "12.5%", "kpiRevenue", sgBlueViolet);
using esegece.sgcWebSockets;
var stat = new TsgcHTMLComponent_StatCard();
stat.Title = "Monthly Revenue";
stat.Value = "$48,200";
stat.Icon = "●";
stat.Color = TsgcHTMLStatColor.scSuccess;
stat.Trend = TsgcHTMLStatTrend.stUp;
stat.TrendValue = "12.5%";
string html = stat.HTML; // Bootstrap card
// Or in a single line with the static helper:
string oneLine = TsgcHTMLComponent_StatCard.Build("Monthly Revenue", "$48,200",
TsgcHTMLStatColor.scSuccess, TsgcHTMLStatTrend.stUp, "12.5%", "kpiRevenue",
TsgcHTMLStatGradient.sgBlueViolet);
最もよく使うメンバーです。
Title はカードのラベルを付け、Value は主要な数値を表示し、Icon は隅にインラインのアイコングリフをレンダリングします。
Trend(TsgcHTMLStatTrend: stUp、stDown、stNeutral)は色付きの矢印を描画し、TrendValue は差分テキストを設定します。
Color(TsgcHTMLStatColor)は、Bootstrap のコンテキストカラーで枠線、値、アイコンのテーマを設定します。
Gradient(TsgcHTMLStatGradient)はプリセットのグラデーションを適用します。GradientStartColor、GradientEndColor、GradientAngle はカスタムのものを定義します。
FooterText はキャプションの行を追加し、CardID は DOM の id を設定し、CSSClass は追加のクラスを付加します。
Build(aTitle, aValue, aColor, aTrend, aTrendValue, aCardID, aGradient) は、カードの HTML を 1 回の静的呼び出しで返します。