ChartAnimation class

Configuration for chart animations.

Controls how charts animate when they first appear and when data changes.

Example:

LineChart(
  data: lineData,
  animation: ChartAnimation(
    duration: Duration(milliseconds: 800),
    curve: Curves.easeOutCubic,
    type: AnimationType.draw,
  ),
)
Annotations

Constructors

ChartAnimation({Duration duration = const Duration(milliseconds: 500), Curve curve = Curves.easeOutCubic, bool animateOnLoad = true, bool animateOnDataChange = true, AnimationType type = AnimationType.draw, Duration? staggerDelay})
Creates an animation configuration.
const
ChartAnimation.fast()
Creates a fast animation configuration.
const
ChartAnimation.none()
Creates a disabled animation configuration.
const
ChartAnimation.slow()
Creates a slow, dramatic animation configuration.
const
ChartAnimation.staggered({Duration duration = const Duration(milliseconds: 500), Curve curve = Curves.easeOutCubic, Duration? delay})
Creates a staggered animation where series animate one after another.
const

Properties

animateOnDataChange bool
Whether to animate when the data changes.
final
animateOnLoad bool
Whether to animate when the chart first appears.
final
curve Curve
The easing curve for the animation.
final
duration Duration
The duration of the animation.
final
enabled bool
Whether animations are enabled.
no setter
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
staggerDelay Duration?
Delay between staggered series animations.
final
type AnimationType
The type of animation to use.
final

Methods

copyWith({Duration? duration, Curve? curve, bool? animateOnLoad, bool? animateOnDataChange, AnimationType? type, Duration? staggerDelay}) ChartAnimation
Creates a copy with the given values replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override