indicatrix / elm-chartjs-webcomponent / Chartjs.Options.Animations

These options are provided to help configure how the animation functions By default, the chart should automatically animate updates good enough for most use cases

For more information, see https://www.chartjs.org/docs/latest/configuration/animations.html


type alias Animations =
{ duration : Maybe Basics.Int
, easing : Maybe Easing
, animateRotate : Maybe Basics.Bool
, animateScale : Maybe Basics.Bool 
}

Animations structure These settings will apply to all the animations in the chart

The default settings should work fine for most cases, but if needed, you can use this object to fine-tune them

defaultAnimations : Animations

Create a blank animations object


type Easing
    = EaseLinear
    | EaseInQuad
    | EaseOutQuad
    | EaseInOutQuad
    | EaseInCubic
    | EaseOutCubic
    | EaseInOutCubic
    | EaseInQuart
    | EaseOutQuart
    | EaseInOutQuart
    | EaseInQuint
    | EaseOutQuint
    | EaseInOutQuint
    | EaseInSine
    | EaseOutSine
    | EaseInOutSine
    | EaseInExpo
    | EaseOutExpo
    | EaseInOutExpo
    | EaseInCirc
    | EaseOutCirc
    | EaseInOutCirc
    | EaseInElastic
    | EaseOutElastic
    | EaseInOutElastic
    | EaseInBack
    | EaseOutBack
    | EaseInOutBack
    | EaseInBounce
    | EaseOutBounce
    | EaseInOutBounce

Different easings for animations To see examples of these easings, see https://easings.net

setEasing : Easing -> Animations -> Animations

Easing function to use

setDuration : Basics.Int -> Animations -> Animations

Time (in milliseconds) an animation takes

setAnimateRotate : Basics.Bool -> Animations -> Animations

Used for Pie charts Should the rotation of the chart be animated?

setAnimateScale : Basics.Bool -> Animations -> Animations

Used for Pie/Polar charts Should the scaling of the chart be animated?