renderData method
Implementation
@override
void renderData(
Canvas canvas,
ChartTransform transform,
BetweenLineData betweenData,
) {
final paint = Paint();
final from = betweenData.from;
final to = betweenData.to;
if (!from.lineType.drawLine || !to.lineType.drawLine) {
return;
}
if (from.line.length < from.lineType.minPoints || to.line.length < to.lineType.minPoints) {
return;
}
final combinedPath = from.lineType.renderer.toPath(from.lineType, from.line);
betweenData.to.lineType.renderer.toPath(to.lineType, to.line, reverse: true, path: combinedPath);
combinedPath
..fillType = betweenData.areaFillType ?? PathFillType.evenOdd
..close();
final tPath = transform.path(combinedPath);
if (betweenData.areaGradient != null) {
paint.shader = betweenData.areaGradient!.createShader(tPath.getBounds());
} else {
paint.shader = null;
paint.color = betweenData.areaColor;
}
paint.style = PaintingStyle.fill;
canvas.drawPath(tPath, paint);
}