drawVerticalText method

  1. @override
void drawVerticalText(
  1. dynamic canvas,
  2. dynamic textStyle,
  3. int gridRows
)
override

Implementation

@override
void drawVerticalText(canvas, textStyle, int gridRows) {
  TextPainter maxTp = TextPainter(
      text: TextSpan(text: "${format(maxValue)}", style: textStyle),
      textDirection: TextDirection.ltr);
  maxTp.layout();
  TextPainter minTp = TextPainter(
      text: TextSpan(text: "${format(minValue)}", style: textStyle),
      textDirection: TextDirection.ltr);
  minTp.layout();

  maxTp.paint(canvas,
      Offset(chartRect.width - maxTp.width, chartRect.top - topPadding));
  minTp.paint(canvas,
      Offset(chartRect.width - minTp.width, chartRect.bottom - minTp.height));
}