Skip to main content

PaddingOptions

Namespace: Wisej.Web.Ext.ChartJS4.Models

Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)

Represents padding values, in pixels, for each side of an element (Chart.js padding object with top, right, bottom and left).

public class PaddingOptions : OptionsBase

Used by Padding. Sides left at their default (0) are not serialized.

Example:

var chart = new ChartJS4();
var padding = chart.ChartOptions.Layout.Padding;
padding.Top = 10;
padding.Right = 20;
padding.Bottom = 10;
padding.Left = 20;

Constructors​

Instance member PaddingOptions()​

Initializes a new instance of PaddingOptions.

Properties​

Instance member Bottom​

Int32: Returns or sets the bottom padding, in pixels (Chart.js padding.bottom).

Value: The bottom padding in pixels. The default is 0.

Setting this property refreshes the chart.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Layout.Padding.Bottom = 25;

Instance member Left​

Int32: Returns or sets the left padding, in pixels (Chart.js padding.left).

Value: The left padding in pixels. The default is 0.

Setting this property refreshes the chart.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Layout.Padding.Left = 25;

Int32: Returns or sets the right padding, in pixels (Chart.js padding.right).

Value: The right padding in pixels. The default is 0.

Setting this property refreshes the chart.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Layout.Padding.Right = 25;

Instance member Top​

Int32: Returns or sets the top padding, in pixels (Chart.js padding.top).

Value: The top padding in pixels. The default is 0.

Setting this property refreshes the chart.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Layout.Padding.Top = 25;

Methods​

Instance member ResetBottom()​

Resets the Bottom property to its default value (0).

Example:

var padding = new PaddingOptions { Bottom = 10 };
padding.ResetBottom();

Instance member ResetLeft()​

Resets the Left property to its default value (0).

Example:

var padding = new PaddingOptions { Left = 10 };
padding.ResetLeft();

Instance member ResetRight()​

Resets the Right property to its default value (0).

Example:

var padding = new PaddingOptions { Right = 10 };
padding.ResetRight();

Instance member ResetTop()​

Resets the Top property to its default value (0).

Example:

var padding = new PaddingOptions { Top = 10 };
padding.ResetTop();

Instance member ShouldSerializeBottom()​

Determines whether the Bottom property should be serialized by the designer.

Returns: Boolean. true if Bottom is not 0; otherwise, false.

Used by the Visual Studio designer together with ResetBottom.

Example:

var padding = new PaddingOptions();
if (padding.ShouldSerializeBottom())
padding.ResetBottom();

Instance member ShouldSerializeLeft()​

Determines whether the Left property should be serialized by the designer.

Returns: Boolean. true if Left is not 0; otherwise, false.

Used by the Visual Studio designer together with ResetLeft.

Example:

var padding = new PaddingOptions();
if (padding.ShouldSerializeLeft())
padding.ResetLeft();

Instance member ShouldSerializeRight()​

Determines whether the Right property should be serialized by the designer.

Returns: Boolean. true if Right is not 0; otherwise, false.

Used by the Visual Studio designer together with ResetRight.

Example:

var padding = new PaddingOptions();
if (padding.ShouldSerializeRight())
padding.ResetRight();

Instance member ShouldSerializeTop()​

Determines whether the Top property should be serialized by the designer.

Returns: Boolean. true if Top is not 0; otherwise, false.

Used by the Visual Studio designer together with ResetTop.

Example:

var padding = new PaddingOptions();
if (padding.ShouldSerializeTop())
padding.ResetTop();