Class TrinityChartWidget<T>
- Namespace
- AbanoubNassem.Trinity.Components.TrinityWidget
- Assembly
- AbanoubNassem.Trinity.dll
A base class for creating chart widgets that inherit from the TrinityWidget<T> base class.
public abstract class TrinityChartWidget<T> : TrinityWidget<T>, ITrinityWidget, ITrinityComponent where T : TrinityChartWidget<T>
Type Parameters
T
The type of the TrinityChartWidget.
- Inheritance
-
TrinityChartWidget<T>
- Implements
- Derived
- Inherited Members
Constructors
TrinityChartWidget()
Initializes a new instance of the T
class.
protected TrinityChartWidget()
Properties
BackgroundColors
Gets or sets the background colors.
public string[]? BackgroundColors { get; protected set; }
Property Value
- string[]
The background colors.
ChartLabels
Gets or sets the chart labels.
public List<object> ChartLabels { get; protected set; }
Property Value
ChartValues
Gets or sets the chart values.
public List<object> ChartValues { get; protected set; }
Property Value
Options
Gets or sets the options for the chart.
public Dictionary<string, object>? Options { get; protected set; }
Property Value
- Dictionary<string, object>
The chart options.
Methods
SetBackgroundColors(params string[])
Sets the background colors with the specified colors.
public T SetBackgroundColors(params string[] colors)
Parameters
colors
string[]The colors.
Returns
- T
The current instance of the
T
widget.
SetChart(params object[])
Sets the chart with the specified chart values.
public T SetChart(params object[] chartValues)
Parameters
chartValues
object[]The chart values.
Returns
- T
The current instance of the
T
widget.
SetChart(params (object, object)[])
Sets the chart with the specified chart label values.
public T SetChart(params (object, object)[] chartLabelValues)
Parameters
Returns
- T
The current instance of the
T
widget.
SetDataset(List<object>, string, string?, string?)
Sets the dataset with the specified data, label, background color, and border color.
public virtual T SetDataset(List<object> data, string label, string? backgroundColor = null, string? borderColor = null)
Parameters
data
List<object>The data.
label
stringThe label.
backgroundColor
stringThe background color.
borderColor
stringThe border color.
Returns
- T
The current instance of the
T
widget.
SetLabels(params object[])
Sets The chart labels.
public T SetLabels(params object[] labels)
Parameters
labels
object[]The chart labels.
Returns
- T
SetOptions(Dictionary<string, object>)
Sets the options for the chart with the specified options.
public T SetOptions(Dictionary<string, object> options)
Parameters
options
Dictionary<string, object>The chart options.
Returns
- T
The current instance of the
T
widget.