ElementsOptions
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Represents the default styling options of the chart elements (Chart.js options.elements): points, lines, bars and arcs.
- C#
- VB.NET
public class ElementsOptions : OptionsBase
Public Class ElementsOptions
Inherits OptionsBase
Assign an instance to Elements. The values defined here apply to all datasets of the chart unless overridden by the dataset options. The nested element options are created lazily on first access and only configured element options are serialized.
Example:
var chart = new ChartJS4();
var elements = new ElementsOptions();
elements.Line.Tension = 0.4;
elements.Point.Radius = 5;
elements.Bar.BorderRadius = 6;
chart.ChartOptions.Elements = elements;
Constructors
ElementsOptions()
Initializes a new instance of ElementsOptions.
Properties
Arc
ArcElementOptions: Returns or sets the default styling of the arc elements used by pie, doughnut and polar area charts (Chart.js options.elements.arc).
Value: A ArcElementOptions instance. The getter lazily creates a default instance on first access; the default is null (not configured).
These defaults apply to all datasets of the chart unless overridden by the dataset options. Only a configured instance is sent to the client. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var elements = new ElementsOptions();
elements.Arc.BorderWidth = 1;
elements.Arc.BorderColor = System.Drawing.Color.White;
chart.ChartOptions.Elements = elements;
Bar
BarElementOptions: Returns or sets the default styling of the bar elements used by bar charts (Chart.js options.elements.bar).
Value: A BarElementOptions instance. The getter lazily creates a default instance on first access; the default is null (not configured).
These defaults apply to all datasets of the chart unless overridden by the dataset options. Only a configured instance is sent to the client. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var elements = new ElementsOptions();
elements.Bar.BorderWidth = 1;
elements.Bar.BorderRadius = 6;
chart.ChartOptions.Elements = elements;
Line
LineElementOptions: Returns or sets the default styling of the line elements used by line and radar charts (Chart.js options.elements.line).
Value: A LineElementOptions instance. The getter lazily creates a default instance on first access; the default is null (not configured).
These defaults apply to all datasets of the chart unless overridden by the dataset options. Only a configured instance is sent to the client. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var elements = new ElementsOptions();
elements.Line.Tension = 0.4;
elements.Line.BorderWidth = 2;
chart.ChartOptions.Elements = elements;
Point
PointElementOptions: Returns or sets the default styling of the point elements used by line, radar, scatter and bubble charts (Chart.js options.elements.point).
Value: A PointElementOptions instance. The getter lazily creates a default instance on first access; the default is null (not configured).
These defaults apply to all datasets of the chart unless overridden by the dataset options. Only a configured instance is sent to the client. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var elements = new ElementsOptions();
elements.Point.Radius = 5;
elements.Point.PointStyle = "rectRot";
chart.ChartOptions.Elements = elements;
Methods
OnChartChanged()
Called when the Chart reference changes.
ResetArc()
Resets the Arc property to its default value.
Discards the current ArcElementOptions instance; a new default instance is created on the next access to Arc. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var elements = new ElementsOptions();
elements.ResetArc();
ResetBar()
Resets the Bar property to its default value.
Discards the current BarElementOptions instance; a new default instance is created on the next access to Bar. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var elements = new ElementsOptions();
elements.ResetBar();
ResetLine()
Resets the Line property to its default value.
Discards the current LineElementOptions instance; a new default instance is created on the next access to Line. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var elements = new ElementsOptions();
elements.ResetLine();
ResetPoint()
Resets the Point property to its default value.
Discards the current PointElementOptions instance; a new default instance is created on the next access to Point. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var elements = new ElementsOptions();
elements.ResetPoint();
ShouldSerializeArc()
Returns whether the Arc property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if the Arc options have been created and at least one of their values differs from its default; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (elements.ShouldSerializeArc())
elements.ResetArc();
ShouldSerializeBar()
Returns whether the Bar property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if the Bar options have been created and at least one of their values differs from its default; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (elements.ShouldSerializeBar())
elements.ResetBar();
ShouldSerializeLine()
Returns whether the Line property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if the Line options have been created and at least one of their values differs from its default; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (elements.ShouldSerializeLine())
elements.ResetLine();
ShouldSerializePoint()
Returns whether the Point property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if the Point options have been created and at least one of their values differs from its default; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (elements.ShouldSerializePoint())
elements.ResetPoint();