getBoundsForBar method

  1. @override
Rectangle<int> getBoundsForBar(
  1. _BarTargetLineRendererElement bar
)

Implementation

@override
Rectangle<int> getBoundsForBar(_BarTargetLineRendererElement bar) {
  final points = bar.points;
  assert(points.isNotEmpty);
  var top = points.first.y;
  var bottom = points.first.y;
  var left = points.first.x;
  var right = points.first.x;
  for (final point in points.skip(1)) {
    top = min(top, point.y);
    left = min(left, point.x);
    bottom = max(bottom, point.y);
    right = max(right, point.x);
  }
  return Rectangle<int>(left, top, right - left, bottom - top);
}