drawNoDataIcon method

  1. @override
  2. @protected
void drawNoDataIcon(
  1. Canvas canvas,
  2. MutableRect bounds,
  3. ChartPaint paint
)
override

Draws three horizontal bars from the left edge of bounds, top to bottom.

Implementation

@override
@protected
void drawNoDataIcon(ui.Canvas canvas, MutableRect bounds, ChartPaint paint) {
  paint.style = PaintStyle.FILL;
  final barHeight = bounds.height() / 4.5;
  final gap = (bounds.height() - 3 * barHeight) / 2;
  final widths = Float32List.fromList([0.55, 1, 0.75]);
  final radius = barHeight / 3.5;
  for (var i = 0; i <= 2; i++) {
    final top = bounds.top + i * (barHeight + gap);
    canvas.drawRoundRectP(
      MutableRect(
        bounds.left,
        top,
        bounds.left + bounds.width() * widths[i],
        top + barHeight,
      ),
      radius,
      radius,
      paint,
    );
  }
}