drawLine method

void drawLine(
  1. double? lastPrice,
  2. double? curPrice,
  3. Canvas canvas,
  4. double lastX,
  5. double curX,
  6. Color color,
)

Implementation

void drawLine(double? lastPrice, double? curPrice, Canvas canvas,
    double lastX, double curX, Color color) {
  if (lastPrice == null || curPrice == null) {
    return;
  }
  //("lasePrice==" + lastPrice.toString() + "==curPrice==" + curPrice.toString());
  double lastY = getY(lastPrice);
  double curY = getY(curPrice);
  //print("lastX-----==" + lastX.toString() + "==lastY==" + lastY.toString() + "==curX==" + curX.toString() + "==curY==" + curY.toString());
  canvas.drawLine(
      Offset(lastX, lastY), Offset(curX, curY), chartPaint..color = color);
}