PointElementOptions
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Represents the default styling options of the point elements used by line, radar, scatter and bubble charts (Chart.js options.elements.point).
- C#
- VB.NET
public class PointElementOptions : OptionsBase
Public Class PointElementOptions
Inherits OptionsBase
An instance is available through Point. These values apply to all datasets that draw points unless overridden by the dataset options.
Example:
var chart = new ChartJS4();
var point = new PointElementOptions();
point.Radius = 5;
point.PointStyle = "rectRot";
chart.ChartOptions.Elements = new ElementsOptions { Point = point };
Constructors
PointElementOptions()
Initializes a new instance of PointElementOptions.
Properties
BackgroundColor
Object: Returns or sets the default fill color of the points (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 point = new PointElementOptions();
point.BackgroundColor = System.Drawing.Color.Orange;
chart.ChartOptions.Elements = new ElementsOptions { Point = point };
BorderWidth
Int32: Returns or sets the default border width, in pixels, of the points (Chart.js option borderWidth). (Default: 1)
Value: The border width in pixels. The default is 1.
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var point = new PointElementOptions();
point.BorderWidth = 2;
chart.ChartOptions.Elements = new ElementsOptions { Point = point };
PointStyle
String: Returns or sets the default shape of the points (Chart.js option pointStyle).
Value: One of "circle", "cross", "crossRot", "dash", "line", "rect", "rectRounded", "rectRot", "star" or "triangle", or null (default) to use the Chart.js default ("circle").
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var point = new PointElementOptions();
point.PointStyle = "triangle";
chart.ChartOptions.Elements = new ElementsOptions { Point = point };
Radius
Int32: Returns or sets the default radius, in pixels, of the points (Chart.js option radius). (Default: 3)
Value: The radius in pixels. The default is 3.
Set it to 0 to hide the points. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var point = new PointElementOptions();
point.Radius = 5;
chart.ChartOptions.Elements = new ElementsOptions { Point = point };
Rotation
Nullable<Double>: Returns or sets the default rotation, in degrees, of the point shapes (Chart.js option rotation).
Value: The rotation in degrees, or null (default) to use the Chart.js default (0).
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var point = new PointElementOptions();
point.PointStyle = "rect";
point.Rotation = 45;
chart.ChartOptions.Elements = new ElementsOptions { Point = point };
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 point = new PointElementOptions();
point.ResetBackgroundColor();
ResetBorderWidth()
Resets the BorderWidth property to its default value.
Sets BorderWidth to 1. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var point = new PointElementOptions();
point.ResetBorderWidth();
ResetPointStyle()
Resets the PointStyle property to its default value.
Sets PointStyle to null (Chart.js default). This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var point = new PointElementOptions();
point.ResetPointStyle();
ResetRadius()
Resets the Radius property to its default value.
Sets Radius to 3. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var point = new PointElementOptions();
point.ResetRadius();
ResetRotation()
Resets the Rotation property to its default value.
Sets Rotation to null (Chart.js default). This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var point = new PointElementOptions();
point.ResetRotation();
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 (point.ShouldSerializeBackgroundColor())
point.ResetBackgroundColor();
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 1; 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 (point.ShouldSerializeBorderWidth())
point.ResetBorderWidth();
ShouldSerializePointStyle()
Returns whether the PointStyle property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if PointStyle 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 (point.ShouldSerializePointStyle())
point.ResetPointStyle();
ShouldSerializeRadius()
Returns whether the Radius property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if Radius is not 3; 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 (point.ShouldSerializeRadius())
point.ResetRadius();
ShouldSerializeRotation()
Returns whether the Rotation property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if Rotation 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 (point.ShouldSerializeRotation())
point.ResetRotation();