lerp method
Lerps a BaseChartData based on t
value, check Tween.lerp.
Implementation
@override
PieChartData lerp(BaseChartData a, BaseChartData b, double t) {
if (a is PieChartData && b is PieChartData) {
return PieChartData(
borderData: FlBorderData.lerp(a.borderData, b.borderData, t),
centerSpaceColor: Color.lerp(a.centerSpaceColor, b.centerSpaceColor, t),
centerSpaceRadius: lerpDoubleAllowInfinity(
a.centerSpaceRadius,
b.centerSpaceRadius,
t,
),
pieTouchData: b.pieTouchData,
sectionsSpace: lerpDouble(a.sectionsSpace, b.sectionsSpace, t),
startDegreeOffset:
lerpDouble(a.startDegreeOffset, b.startDegreeOffset, t),
sections: lerpPieChartSectionDataList(a.sections, b.sections, t),
titleSunbeamLayout: b.titleSunbeamLayout,
);
} else {
throw Exception('Illegal State');
}
}