BarTouchTooltipData constructor

BarTouchTooltipData({
  1. double? tooltipRoundedRadius,
  2. EdgeInsets? tooltipPadding,
  3. double? tooltipMargin,
  4. FLHorizontalAlignment? tooltipHorizontalAlignment,
  5. double? tooltipHorizontalOffset,
  6. double? maxContentWidth,
  7. GetBarTooltipItem? getTooltipItem,
  8. GetBarTooltipColor? getTooltipColor,
  9. bool? fitInsideHorizontally,
  10. bool? fitInsideVertically,
  11. TooltipDirection? direction,
  12. double? rotateAngle,
  13. BorderSide? tooltipBorder,
})

if BarTouchData.handleBuiltInTouches is true, BarChart shows a tooltip popup on top of rods automatically when touch happens, otherwise you can show it manually using BarChartGroupData.showingTooltipIndicators. Tooltip shows on top of rods, with getTooltipColor as a background color, and you can set corner radius using tooltipRoundedRadius. If you want to have a padding inside the tooltip, fill tooltipPadding, or If you want to have a bottom margin, set tooltipMargin. Content of the tooltip will provide using getTooltipItem callback, you can override it and pass your custom data to show in the tooltip. You can restrict the tooltip's width using maxContentWidth. Sometimes, BarChart shows the tooltip outside of the chart, you can set fitInsideHorizontally true to force it to shift inside the chart horizontally, also you can set fitInsideVertically true to force it to shift inside the chart vertically.

Implementation

BarTouchTooltipData({
  double? tooltipRoundedRadius,
  EdgeInsets? tooltipPadding,
  double? tooltipMargin,
  FLHorizontalAlignment? tooltipHorizontalAlignment,
  double? tooltipHorizontalOffset,
  double? maxContentWidth,
  GetBarTooltipItem? getTooltipItem,
  GetBarTooltipColor? getTooltipColor,
  bool? fitInsideHorizontally,
  bool? fitInsideVertically,
  TooltipDirection? direction,
  double? rotateAngle,
  BorderSide? tooltipBorder,
})  : tooltipRoundedRadius = tooltipRoundedRadius ?? 4,
      tooltipPadding = tooltipPadding ??
          const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
      tooltipMargin = tooltipMargin ?? 16,
      tooltipHorizontalAlignment =
          tooltipHorizontalAlignment ?? FLHorizontalAlignment.center,
      tooltipHorizontalOffset = tooltipHorizontalOffset ?? 0,
      maxContentWidth = maxContentWidth ?? 120,
      getTooltipItem = getTooltipItem ?? defaultBarTooltipItem,
      getTooltipColor = getTooltipColor ?? defaultBarTooltipColor,
      fitInsideHorizontally = fitInsideHorizontally ?? false,
      fitInsideVertically = fitInsideVertically ?? false,
      direction = direction ?? TooltipDirection.auto,
      rotateAngle = rotateAngle ?? 0.0,
      tooltipBorder = tooltipBorder ?? BorderSide.none,
      super();