drawChart method

  1. @override
void drawChart(
  1. VolumeEntity lastPoint,
  2. VolumeEntity curPoint,
  3. double lastX,
  4. double curX,
  5. Size size,
  6. 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);
}