drawChart method
void
drawChart(
- VolumeEntity lastPoint,
- VolumeEntity curPoint,
- double lastX,
- double curX,
- Size size,
- Canvas canvas,
override
Implementation
@override
void drawChart(VolumeEntity lastPoint, VolumeEntity curPoint, double lastX, double curX, Size size, Canvas canvas) {
double r = style.width / 2;
double top = getVolY(curPoint.vol);
double bottom = chartRect.bottom;
if (curPoint.vol != 0) {
canvas.drawRect(
Rect.fromLTRB(curX - r, top, curX + r, bottom),
chartPaint..color = curPoint.close > curPoint.open ? style.colors.up : style.colors.down
);
}
if (lastPoint.MA5Volume != 0) drawLine(lastPoint.MA5Volume, curPoint.MA5Volume, canvas, lastX, curX, style.colors.ma5);
if (lastPoint.MA10Volume != 0) drawLine(lastPoint.MA10Volume, curPoint.MA10Volume, canvas, lastX, curX, style.colors.ma10);
}