ArcElementOptions
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Represents the default styling options of the arc elements used by pie, doughnut and polar area charts (Chart.js options.elements.arc).
- C#
- VB.NET
public class ArcElementOptions : OptionsBase
Public Class ArcElementOptions
Inherits OptionsBase
An instance is available through Arc. These values apply to all arc datasets unless overridden by the dataset options.
Example:
var chart = new ChartJS4();
var arc = new ArcElementOptions();
arc.BorderWidth = 1;
arc.BorderColor = System.Drawing.Color.White;
chart.ChartOptions.Elements = new ElementsOptions { Arc = arc };
Constructors
ArcElementOptions()
Initializes a new instance of ArcElementOptions.
Properties
BackgroundColor
Object: Returns or sets the default fill color of the arcs (Chart.js option backgroundColor).
Value: A Color, a CSS color string, or an array of colors. The default is null, which uses the Chart.js default color.
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var arc = new ArcElementOptions();
arc.BackgroundColor = new[] { "#36a2eb", "#ff6384", "#ffce56" };
chart.ChartOptions.Elements = new ElementsOptions { Arc = arc };
BorderColor
Object: Returns or sets the default border color of the arcs (Chart.js option borderColor).
Value: A Color, a CSS color string, or an array of colors. The default is null, which uses the Chart.js default ("#fff").
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var arc = new ArcElementOptions();
arc.BorderColor = System.Drawing.Color.White;
chart.ChartOptions.Elements = new ElementsOptions { Arc = arc };
BorderWidth
Int32: Returns or sets the default border width, in pixels, of the arcs (Chart.js option borderWidth). (Default: 2)
Value: The border width in pixels. The default is 2.
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var arc = new ArcElementOptions();
arc.BorderWidth = 1;
chart.ChartOptions.Elements = new ElementsOptions { Arc = arc };
Methods
ResetBackgroundColor()
Resets the BackgroundColor property to its default value.
Sets BackgroundColor to null. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var arc = new ArcElementOptions();
arc.ResetBackgroundColor();
ResetBorderColor()
Resets the BorderColor property to its default value.
Sets BorderColor to null. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var arc = new ArcElementOptions();
arc.ResetBorderColor();
ResetBorderWidth()
Resets the BorderWidth property to its default value.
Sets BorderWidth to 2. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var arc = new ArcElementOptions();
arc.ResetBorderWidth();
ShouldSerializeBackgroundColor()
Returns whether the BackgroundColor property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if BackgroundColor is not null; 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 (arc.ShouldSerializeBackgroundColor())
arc.ResetBackgroundColor();
ShouldSerializeBorderColor()
Returns whether the BorderColor property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if BorderColor is not null; 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 (arc.ShouldSerializeBorderColor())
arc.ResetBorderColor();
ShouldSerializeBorderWidth()
Returns whether the BorderWidth property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if BorderWidth is not 2; 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 (arc.ShouldSerializeBorderWidth())
arc.ResetBorderWidth();