drawLabelsX method

void drawLabelsX(
  1. Canvas canvas,
  2. Size margin,
  3. Size graph,
  4. Size cell,
)

Implementation

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