Skip to main content

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).

public class PointElementOptions : 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​

Instance member PointElementOptions()​

Initializes a new instance of PointElementOptions.

Properties​

Instance member 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 };

Instance member 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 };

Instance member 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 };

Instance member 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 };

Instance member 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​

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();

Instance member 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();