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).
- C#
- VB.NET
public class PaddingOptions : OptionsBase
Public Class PaddingOptions
Inherits 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
PaddingOptions()
Initializes a new instance of PaddingOptions.
Properties
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;
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;
Right
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;
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
ResetBottom()
Resets the Bottom property to its default value (0).
Example:
var padding = new PaddingOptions { Bottom = 10 };
padding.ResetBottom();
ResetLeft()
Resets the Left property to its default value (0).
Example:
var padding = new PaddingOptions { Left = 10 };
padding.ResetLeft();
ResetRight()
Resets the Right property to its default value (0).
Example:
var padding = new PaddingOptions { Right = 10 };
padding.ResetRight();
ResetTop()
Resets the Top property to its default value (0).
Example:
var padding = new PaddingOptions { Top = 10 };
padding.ResetTop();
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();
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();
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();
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();