BorderOptions
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Represents the options of the axis border line, drawn at the edge between the axis and the chart area (Chart.js scales[id].border).
- C#
- VB.NET
public class BorderOptions : OptionsBase
Public Class BorderOptions
Inherits OptionsBase
An instance is lazily created by Border. Additional Chart.js border options, such as dash, dashOffset or z, can be supplied through ExtensionData.
Example:
var chart = new ChartJS4();
var border = chart.ChartOptions.Scales.Y.Border;
border.Color = System.Drawing.Color.Gray;
border.Width = 2;
Constructors
BorderOptions()
Initializes a new instance of BorderOptions.
Properties
Color
Object: Returns or sets the color of the axis border line (Chart.js border.color).
Value: A Color or a CSS color string (e.g. "#ff0000" or "rgba(0,0,0,0.3)"), or null (default) to use the Chart.js default color.
Setting this property refreshes the chart.
Example:
var chart = new ChartJS4();
chart.ChartOptions.Scales.X.Border.Color = "rgba(0, 0, 0, 0.5)";
Display
Boolean: Returns or sets a value indicating whether the axis border line is drawn (Chart.js border.display). (Default: True)
Value: true to draw the border; otherwise, false. The default is true.
Setting this property refreshes the chart.
Example:
var chart = new ChartJS4();
bool borderVisible = chart.ChartOptions.Scales.X.Border.Display;
Width
Int32: Returns or sets the width of the axis border line, in pixels (Chart.js border.width). (Default: 1)
Value: The border width in pixels. The default is 1.
Setting this property refreshes the chart.
Example:
var chart = new ChartJS4();
chart.ChartOptions.Scales.Y.Border.Width = 3;
Methods
ResetColor()
Resets the Color property to its default value (null).
Example:
var border = new BorderOptions { Color = "red" };
border.ResetColor();
ResetDisplay()
Resets the Display property to its default value (true).
Example:
var border = new BorderOptions();
border.ResetDisplay();
ResetWidth()
Resets the Width property to its default value (1).
Example:
var border = new BorderOptions { Width = 3 };
border.ResetWidth();
ShouldSerializeColor()
Determines whether the Color property should be serialized by the designer.
Returns: Boolean. true if Color is not null; otherwise, false.
Used by the Visual Studio designer together with ResetColor.
Example:
var border = new BorderOptions();
if (border.ShouldSerializeColor())
border.ResetColor();
ShouldSerializeDisplay()
Determines whether the Display property should be serialized by the designer.
Returns: Boolean. true if Display is not true; otherwise, false.
Used by the Visual Studio designer together with ResetDisplay.
Example:
var border = new BorderOptions();
if (border.ShouldSerializeDisplay())
border.ResetDisplay();
ShouldSerializeWidth()
Determines whether the Width property should be serialized by the designer.
Returns: Boolean. true if Width is not 1; otherwise, false.
Used by the Visual Studio designer together with ResetWidth.
Example:
var border = new BorderOptions();
if (border.ShouldSerializeWidth())
border.ResetWidth();