ChartModelBase
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Base class for chart models that need a back-reference to the owning chart.
- C#
- VB.NET
public abstract class ChartModelBase
Public MustInherit Class ChartModelBase
Derived models (options and data sets) use the back-reference to refresh the owning ChartJS4 control when one of their properties changes. When a property is assigned a child ChartModelBase instance, the child is automatically bound to the same chart.
Example:
var dataSet = new LineDataSet { Label = "Temperature" };
chart.DataSets.Add(dataSet);
// dataSet.Chart == chart: changing a property now refreshes the chart.
dataSet.BorderWidth = 3;
Properties
Chart
ChartJS4: Returns or sets the owning chart instance.
Value: The ChartJS4 control that owns this model, or null if the model is not attached to a chart.
The value is set automatically when the model is assigned to ChartOptions, added to DataSets, or assigned to a property of another attached model. It is excluded from JSON serialization and hidden from the property grid.
Example:
var owner = chart.ChartOptions.Chart; // == chart
var dataSet = new BarDataSet();
chart.DataSets.Add(dataSet); // dataSet.Chart == chart
Methods
OnChartChanged()
Called when the Chart reference changes.
SetProperty<T>(field, value, propertyName)
Assigns the field value and triggers chart updates when changed.
| Parameter | Type | Description |
|---|---|---|
| T | ||
| field | T | |
| value | T | |
| propertyName | String |
Returns: Boolean.
Update()
Triggers a chart refresh.
Inherited By
| Name | Description |
|---|---|
| AnimationsOptions | Animation options. |
| ArcElementOptions | Represents the default styling options of the arc elements used by pie, doughnut and polar area charts (Chart.js options.elements.arc). |
| AxisOptions | Represents the configuration of a chart axis (scale), serialized as a Chart.js scales[id] entry. |
| AxisTitleOptions | Represents the options of an axis title, the label displayed along an axis (Chart.js scales[id].title). |
| BarElementOptions | Represents the default styling options of the bar elements used by bar charts (Chart.js options.elements.bar). |
| BorderOptions | Represents the options of the axis border line, drawn at the edge between the axis and the chart area (Chart.js scales[id].border). |
| ChartDataSet | Base class for all chart data sets. Represents data to be plotted on a chart with flexible serialization. |
| LineDataSet | Data set for line charts. |
| BarDataSet | Data set for bar charts. |
| PieDataSet | Data set for pie and doughnut charts. |
| BubbleDataSet | Data set for bubble charts. |
| ScatterDataSet | Data set for scatter charts. |
| RadarDataSet | Data set for radar charts. |
| PolarAreaDataSet | Data set for polar area charts. |
| ChartOptions | Base class for all chart options. Uses System.Text.Json for modern, flexible serialization. |
| DataLabelsOptions | Represents the options of the chartjs-plugin-datalabels plugin (Chart.js options.plugins.datalabels), which draws labels next to or on top of the data elements. |
| DecimationOptions | Represents the options of the Chart.js decimation plugin (options.plugins.decimation), used to downsample large line chart datasets for faster rendering. |
| ElementsOptions | Represents the default styling options of the chart elements (Chart.js options.elements): points, lines, bars and arcs. |
| FillerOptions | Represents the options of the Chart.js filler plugin (options.plugins.filler), which fills the area of line and radar datasets that have the fill option set. |
| FontOptions | Represents the font options used to render text elements of the chart (Chart.js font object with family, size, style, weight and lineHeight). |
| GridOptions | Represents the grid line options of an axis (Chart.js scales[id].grid). |
| InteractionOptions | Represents the Chart.js interaction options (options.interaction) that control how hover and tooltip interactions select chart elements. |
| LayoutOptions | Represents the chart layout options (Chart.js options.layout). |
| LegendLabelsOptions | Represents the configuration of the legend labels (Chart.js options.plugins.legend.labels), which controls the colored boxes and text of each legend item. |
| LegendOptions | Represents the configuration of the Chart.js legend plugin (options.plugins.legend), which displays the datasets of the chart and lets the user toggle them. |
| LegendTitleOptions | Represents the configuration of the legend title (Chart.js options.plugins.legend.title). |
| LineElementOptions | Represents the default styling options of the line elements used by line and radar charts (Chart.js options.elements.line). |
| OptionsBase | Base class for Chart.js option groups (e.g. legend, title, scales) that can detect and restore their default state. |
| PaddingOptions | Represents padding values, in pixels, for each side of an element (Chart.js padding object with top, right, bottom and left). |
| PluginsOptions | Represents the configuration of the built-in Chart.js plugins (Chart.js options.plugins): legend, title, subtitle, tooltip, decimation, filler and the chartjs-plugin-datalabels plugin. |
| PointElementOptions | Represents the default styling options of the point elements used by line, radar, scatter and bubble charts (Chart.js options.elements.point). |
| ScalesOptions | Scales options (Chart.js options.scales). |
| SubtitleOptions | Represents the configuration of the Chart.js subtitle plugin (options.plugins.subtitle), which draws a second line of text below the chart title. |
| TickOptions | Represents the options of the tick labels of an axis (Chart.js scales[id].ticks). |
| TitleOptions | Represents the configuration of the Chart.js title plugin (options.plugins.title), which draws a title above (or beside) the chart. |
| TooltipOptions | Represents the configuration of the Chart.js tooltip plugin (options.plugins.tooltip), which controls when tooltips are shown, how they are positioned and how they look. |
| TransitionsOptions | Transitions options (Chart.js options.transitions). |