Class StatsWidget
Represents a widget that displays stats.
public class StatsWidget : TrinityWidget<StatsWidget>, ITrinityWidget, ITrinityComponent
- Inheritance
-
StatsWidget
- Implements
- Inherited Members
Constructors
StatsWidget(string, string)
Initializes a new instance of the StatsWidget class with the specified title and value.
public StatsWidget(string title, string value)
Parameters
Properties
ChartBackgroundColor
Gets or sets the background color of the chart displayed in the widget.
public string? ChartBackgroundColor { get; protected set; }
Property Value
ChartBorderColor
Gets or sets the border color of the chart displayed in the widget.
public string? ChartBorderColor { get; protected set; }
Property Value
ChartLabels
Gets or sets the labels for the chart displayed in the widget.
public object[]? ChartLabels { get; protected set; }
Property Value
- object[]
ChartValues
Gets or sets the values for the chart displayed in the widget.
public object[]? ChartValues { get; protected set; }
Property Value
- object[]
ComponentName
The component name in the front-end side.
public override string ComponentName { get; }
Property Value
Description
Gets or sets the description to display.
public string? Description { get; protected set; }
Property Value
DescriptionColor
Gets or sets the color of the description.
public string? DescriptionColor { get; protected set; }
Property Value
Icon
Gets or sets the icon to display.
public string? Icon { get; protected set; }
Property Value
IconBackgroundColor
Gets or sets the background color of the icon.
public string? IconBackgroundColor { get; protected set; }
Property Value
IconColor
Gets or sets the color of the icon.
public string? IconColor { get; protected set; }
Property Value
Title
Gets the title of the widget.
public string Title { get; protected set; }
Property Value
Value
Gets the value to display.
public string Value { get; protected set; }
Property Value
Methods
SetChart(params object[])
Sets the values for the chart displayed in the widget.
public StatsWidget SetChart(params object[] chartValues)
Parameters
chartValues
object[]An array of chart values.
Returns
- StatsWidget
The current instance of the StatsWidget class.
SetChart(params (object, object)[])
Sets the labels and values for the chart displayed in the widget.
public StatsWidget SetChart(params (object, object)[] chartLabelValues)
Parameters
Returns
- StatsWidget
The current instance of the StatsWidget class.
SetChartBackgroundColor(string)
Sets the background color of the chart displayed in the widget.
public StatsWidget SetChartBackgroundColor(string color)
Parameters
color
stringThe chart background color.
Returns
- StatsWidget
The current instance of the StatsWidget class.
SetChartBorderColor(string)
Sets the border color of the chart displayed in the widget.
public StatsWidget SetChartBorderColor(string color)
Parameters
color
stringThe chart border color.
Returns
- StatsWidget
The current instance of the StatsWidget class.
SetDescription(string, string?)
Sets the description to display with the specified color.
public StatsWidget SetDescription(string description, string? color = null)
Parameters
description
stringThe description to display.
color
stringThe color of the description. Default is null.
Returns
- StatsWidget
The current StatsWidget instance.
SetIcon(string, string, string)
Sets the icon to display with the specified color and background color.
public StatsWidget SetIcon(string icon, string color = "#3b82f6", string backgroundColor = "#d0e1fd")
Parameters
icon
stringThe icon to display.
color
stringThe color of the icon. Default is "#3b82f6".
backgroundColor
stringThe background color of the icon. Default is "#d0e1fd".
Returns
- StatsWidget
The current StatsWidget instance.