Skip to main content

LayoutOptions

Namespace: Wisej.Web.Ext.ChartJS4.Models

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

Represents the chart layout options (Chart.js options.layout).

public class LayoutOptions : OptionsBase

Use Padding to reserve space between the edge of the canvas and the chart area. An instance is lazily created by Layout.

Example:

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

Constructors​

Instance member LayoutOptions()​

Initializes a new instance of LayoutOptions.

Properties​

Instance member Padding​

PaddingOptions: Returns or sets the padding to add inside the chart, around the chart area (Chart.js layout.padding).

Value: A PaddingOptions instance. The getter lazily creates a default instance when none is set.

Setting any of the padding values refreshes the chart.

Example:

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

Methods​

Protected member OnChartChanged()​

Called when the Chart reference changes.

Instance member ResetExtensionData()​

Resets the ExtensionData property to its default value (null).

Example:

var layout = new LayoutOptions();
layout.ResetExtensionData();

Instance member ResetPadding()​

Resets the Padding property to its default value by discarding the current PaddingOptions instance.

Used by the designer. A new default instance is created the next time Padding is read.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Layout.ResetPadding();

Instance member ShouldSerializeExtensionData()​

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

Returns: Boolean. true if ExtensionData contains at least one entry; otherwise, false.

Used by the Visual Studio designer together with ResetExtensionData.

Example:

var layout = new LayoutOptions();
if (layout.ShouldSerializeExtensionData())
layout.ResetExtensionData();

Instance member ShouldSerializePadding()​

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

Returns: Boolean. true if the designer should persist the Padding value; otherwise, false.

Used by the Visual Studio designer together with ResetPadding.

Example:

var layout = new LayoutOptions();
if (layout.ShouldSerializePadding())
layout.ResetPadding();