drawBarShadow method
draw the main bar line's shadow by the barPath
Implementation
@visibleForTesting
void drawBarShadow(
CanvasWrapper canvasWrapper,
Path barPath,
LineChartBarData barData,
) {
if (!barData.show || barData.shadow.color.opacity == 0.0) {
return;
}
_barPaint
..strokeCap = barData.isStrokeCapRound ? StrokeCap.round : StrokeCap.butt
..strokeJoin =
barData.isStrokeJoinRound ? StrokeJoin.round : StrokeJoin.miter
..color = barData.shadow.color
..shader = null
..strokeWidth = barData.barWidth
..color = barData.shadow.color
..maskFilter = MaskFilter.blur(
BlurStyle.normal,
Utils().convertRadiusToSigma(barData.shadow.blurRadius),
);
barPath = barPath.toDashedPath(barData.dashArray);
barPath = barPath.shift(barData.shadow.offset);
canvasWrapper.drawPath(
barPath,
_barPaint,
);
}