buildContext method

ChartContext buildContext(
  1. Size size, {
  2. double animationValue = 1.0,
  3. ChartHitResult? hoveredHit,
  4. ChartHitResult? selectedHit,
  5. Offset? crosshairPosition,
})

Implementation

ChartContext buildContext(
  Size size, {
  double animationValue = 1.0,
  ChartHitResult? hoveredHit,
  ChartHitResult? selectedHit,
  Offset? crosshairPosition,
}) {
  final bounds = ChartBounds.fromSize(size, margins: _plotMargins());
  final viewport = _resolveViewport();

  return ChartContext(
    config: config,
    theme: theme,
    bounds: bounds,
    viewport: viewport,
    transformer: CoordinateTransformer(viewport: viewport, bounds: bounds),
    paintCache: _paintCache,
    animationValue: animationValue,
    hoveredHit: hoveredHit,
    selectedHit: selectedHit,
    crosshairPosition: crosshairPosition,
    zoomPan: zoomPan,
  );
}