Table of Contents

Class StatsWidget

Namespace
AbanoubNassem.Trinity.Widgets
Assembly
AbanoubNassem.Trinity.dll

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

title string

The title of the widget.

value string

The value to display.

Properties

ChartBackgroundColor

Gets or sets the background color of the chart displayed in the widget.

public string? ChartBackgroundColor { get; protected set; }

Property Value

string

ChartBorderColor

Gets or sets the border color of the chart displayed in the widget.

public string? ChartBorderColor { get; protected set; }

Property Value

string

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

string

Description

Gets or sets the description to display.

public string? Description { get; protected set; }

Property Value

string

DescriptionColor

Gets or sets the color of the description.

public string? DescriptionColor { get; protected set; }

Property Value

string

Icon

Gets or sets the icon to display.

public string? Icon { get; protected set; }

Property Value

string

IconBackgroundColor

Gets or sets the background color of the icon.

public string? IconBackgroundColor { get; protected set; }

Property Value

string

IconColor

Gets or sets the color of the icon.

public string? IconColor { get; protected set; }

Property Value

string

Title

Gets the title of the widget.

public string Title { get; protected set; }

Property Value

string

Value

Gets the value to display.

public string Value { get; protected set; }

Property Value

string

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

chartLabelValues (object, object)[]

A collection of tuples containing the chart labels and values.

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 string

The 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 string

The 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 string

The description to display.

color string

The 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 string

The icon to display.

color string

The color of the icon. Default is "#3b82f6".

backgroundColor string

The background color of the icon. Default is "#d0e1fd".

Returns

StatsWidget

The current StatsWidget instance.