Skip to main content

AnimationsOptions

Namespace: Wisej.Web.Ext.ChartJS4.Models

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

Animation options.

public class AnimationsOptions : OptionsBase

Represents a Chart.js animation configuration (duration, easing, delay, loop). An instance is typically assigned to Animation to configure the global animation. Only values that differ from their defaults are sent to the client, and additional Chart.js animation properties (e.g. from, to, type) can be supplied through ExtensionData.

Example:

var chart = new ChartJS4();
chart.ChartOptions.Animation = new AnimationsOptions
{
Duration = 2000,
Easing = "easeOutBounce",
Delay = 250
};

Constructors​

Instance member AnimationsOptions()​

Initializes a new instance of AnimationsOptions.

Properties​

Instance member Delay​

Int32: Returns or sets the delay, in milliseconds, before starting the animation. (Default: 0)

Value: An Int32 in milliseconds. The default is 0. Maps to the Chart.js delay option.

Example:

var animation = new AnimationsOptions { Delay = 300, Duration = 800 };
chart.ChartOptions.Animation = animation;

Instance member Duration​

Int32: Returns or sets the number of milliseconds an animation takes. (Default: 1000)

Value: An Int32 in milliseconds. The default is 1000. Maps to the Chart.js duration option.

Set it to 0 to disable the animation.

Example:

var animation = new AnimationsOptions { Duration = 500 };
chart.ChartOptions.Animation = animation;

Instance member Easing​

String: Returns or sets the easing function to use. Available options: 'linear', 'easeInQuad', 'easeOutQuad', etc. (Default: null)

Value: The name of a Chart.js easing function. The default is null (Chart.js default "easeOutQuart"). Maps to the Chart.js easing option.

Accepted values: "linear", and the easeIn/easeOut/easeInOut variants of Quad, Cubic, Quart, Quint, Sine, Expo, Circ, Elastic, Back and Bounce (e.g. "easeInOutCubic", "easeOutBounce").

Example:

var animation = new AnimationsOptions { Easing = "easeInOutCubic" };
chart.ChartOptions.Animation = animation;

Instance member Loop​

Boolean: Returns or sets whether the animation loops endlessly. (Default: False)

Value: true to repeat the animation indefinitely; otherwise false. The default is false. Maps to the Chart.js loop option.

Example:

var animation = new AnimationsOptions { Duration = 1500, Loop = true };
chart.ChartOptions.Animation = animation;

Methods​

Instance member ResetDelay()​

Resets the Delay property to its default value of 0.

Used by the Visual Studio designer when the user resets the property.

Example:

animation.ResetDelay();

Instance member ResetDuration()​

Resets the Duration property to its default value of 1000.

Used by the Visual Studio designer when the user resets the property.

Example:

animation.ResetDuration();

Instance member ResetEasing()​

Resets the Easing property to its default value of null.

Used by the Visual Studio designer when the user resets the property.

Example:

animation.ResetEasing();

Instance member ResetExtensionData()​

Resets the ExtensionData property to its default value of null.

Used by the Visual Studio designer when the user resets the property.

Example:

animation.ResetExtensionData();

Instance member ResetLoop()​

Resets the Loop property to its default value of false.

Used by the Visual Studio designer when the user resets the property.

Example:

animation.ResetLoop();

Instance member ShouldSerializeDelay()​

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

Returns: Boolean. true if Delay is not 0 (its default value); otherwise false.

Used by the Visual Studio designer to decide whether to generate code for the property.

Example:

if (animation.ShouldSerializeDelay())
animation.ResetDelay();

Instance member ShouldSerializeDuration()​

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

Returns: Boolean. true if Duration is not 1000 (its default value); otherwise false.

Used by the Visual Studio designer to decide whether to generate code for the property.

Example:

if (animation.ShouldSerializeDuration())
animation.ResetDuration();

Instance member ShouldSerializeEasing()​

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

Returns: Boolean. true if Easing is not null; otherwise false.

Used by the Visual Studio designer to decide whether to generate code for the property.

Example:

if (animation.ShouldSerializeEasing())
animation.ResetEasing();

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 to decide whether to generate code for the property.

Example:

if (animation.ShouldSerializeExtensionData())
animation.ResetExtensionData();

Instance member ShouldSerializeLoop()​

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

Returns: Boolean. true if Loop is not false (its default value); otherwise false.

Used by the Visual Studio designer to decide whether to generate code for the property.

Example:

if (animation.ShouldSerializeLoop())
animation.ResetLoop();