transformValues method
Transforms the x and y values to screen coordinates.
Implementation
@override
void transformValues() {
fillPath.reset();
double degree = _degree * animationFactor;
final double angle = calculateAngle(
series.animationFactor == 1, series.startAngle, series.endAngle);
final double startAngle = lerpDouble(
_priorEndAngle.isNaN ? angle : _priorStartAngle,
_startAngle,
animationFactor)!;
final double endAngle = _priorEndAngle.isNaN
? startAngle + degree
: lerpDouble(_priorEndAngle, _endAngle, animationFactor)!;
degree = _priorEndAngle.isNaN ? degree : endAngle - startAngle;
// If the startAngle and endAngle value is same, then degree will be 0.
// Hence no need to render segments.
if (!isVisible && degree == 0) {
return;
}
if (series.explode && _isExploded) {
final double midAngle = (_startAngle + _endAngle) / 2;
_center = calculateExplodingCenter(
midAngle, _outerRadius, series.center, series.explodeOffset);
} else {
_center = series.center;
}
fillPath = calculateArcPath(
_innerRadius, _outerRadius, _center, startAngle, endAngle, degree,
isAnimate: true);
}