animate method
void
animate()
If you wish to perform initial animation again in the existing series,
this method can be called.
On calling this method, this particular series will be animated again
based on the animationDuration
property's value in the series. If the value is 0, then the animation
will not be performed.
Widget build(BuildContext context) {
ChartSeriesController? _chartSeriesController;
return Column(
children: <Widget>[
SfCartesianChart(
series: <LineSeries<SalesData, num>>[
LineSeries<SalesData, num>(
onRendererCreated: (ChartSeriesController controller) {
_chartSeriesController = controller;
},
),
]
),
TextButton(
child: Text("Animate series"),
onPressed: () {
_chartSeriesController?.animate();
}
)
]
);
}
Implementation
void animate() {
seriesRenderer.animationType = AnimationType.loading;
}