drawYLabel method

void drawYLabel(
  1. CanvasRenderingContext2D ctx,
  2. int x,
  3. int y,
  4. double value,
  5. int decimals,
)

Implementation

void drawYLabel(
    CanvasRenderingContext2D ctx, int x, int y, double value, int decimals) {
  final roundedValue = roundDouble(value, decimals);
  ctx
    ..beginPath()
    ..moveTo(x, y)
    ..lineTo(x + style.dashLength, y)
    ..stroke();
  final label = roundedValue.toStringAsFixed(decimals);
  ctx.fillText(label, x + style.yLabelIndent, y);
}