Animations

Implicit Animations for Charts.

All Animations in the chart widgets are Implicitly Animated. The default animation behaviour for all chart widgets is:

  1. animates when the widget loads for the first time.

  2. animates for every new data updates.

You can override the default behaviour using the animateOnLoad and animateOnUpdate properties at top level widget.

...
import 'package:chart_it/chart_it.dart';
	
...
child: BarChart(
  animateOnLoad: false,
  animateOnUpdate: true,
  animationDuration: const Duration(milliseconds: 750),
  data: BarSeries(
  ...

All animations in the widget are handled internally. However, if you wish to control your own animation, then you can provide your own custom AnimationController to the top level property animation.

...
import 'package:chart_it/chart_it.dart';
	
...
child: BarChart(
  animation: AnimationController(
    duration: Duration(milliseconds: 500),
    vsync: this, 
  ),
  data: BarSeries(
  ...

Last updated