drawLabelsY method

void drawLabelsY(
  1. Canvas canvas,
  2. Size size,
  3. Size margin,
  4. Size graph,
  5. Size cell,
)

Implementation

void drawLabelsY(
    Canvas canvas, Size size, Size margin, Size graph, Size cell) {
  for (int i = 0; i < labelY!.length; i++) {
    TextSpan span = new TextSpan(
      style: new TextStyle(
        color: graphColor,
        fontFamily: fontFamily,
      ),
      text: labelY![i],
    );
    TextPainter tp = new TextPainter(
      text: span,
      textAlign: TextAlign.left,
      textDirection: TextDirection.ltr,
    );
    tp.layout();
    tp.paint(
      canvas,
      new Offset(
        size.width / 20,
        margin.height + graph.height - 8 - (i + 1) * cell.height,
      ),
    );
  }
}