BubbleHoverCallback typedef

BubbleHoverCallback = ChartPointHoverCallback

Callback for bubble chart hover interactions.

Invoked when the mouse enters or exits a bubble area in bubble charts. When the mouse exits, all parameters will be null.

Supported Charts:

  • Bubble charts (BubbleChartWidget)

Parameters:

  • point - The hovered bubble data point, or null if mouse exited
  • datasetIndex - The dataset index, or null if mouse exited
  • pointIndex - The point index, or null if mouse exited

Usage Notes:

  • This callback is nullable - if null, hover interactions are disabled
  • Platform Support: Desktop and web only (mouse hover not available on mobile)
  • The hover detection uses ChartInteractionConstants.hoverRadius * 3 for hit detection (larger radius due to bubble size variability)
  • All parameters are nullable - check for null to detect mouse exit

Example

onBubbleHover: (point, datasetIndex, pointIndex) {
  if (point != null) {
    final bubble = point as BubbleDataPoint;
    showTooltip('Value: ${bubble.y}, Size: ${bubble.size}');
  } else {
    hideTooltip();
  }
}

See also:

  • onBubbleTap for tap events (all platforms)
  • ChartPointHoverCallback for other point-based charts
  • ChartInteractionConstants for interaction configuration

Implementation

typedef BubbleHoverCallback = ChartPointHoverCallback;