paintBackground method

  1. @override
void paintBackground(
  1. Context context
)
override

Implementation

@override
void paintBackground(Context context) {
  if (data.isEmpty) {
    return;
  }

  final grid = Chart.of(context).grid;

  if (drawSurface) {
    _drawSurface(context, grid);

    if (surfaceOpacity != 1) {
      context.canvas
        ..saveContext()
        ..setGraphicState(
          PdfGraphicState(opacity: surfaceOpacity),
        );
    }

    context.canvas
      ..setFillColor(surfaceColor ?? color)
      ..fillPath();

    if (surfaceOpacity != 1) {
      context.canvas.restoreContext();
    }
  }
}