ScatterTouchTooltipData constructor
- double? tooltipRoundedRadius,
- EdgeInsets? tooltipPadding,
- FLHorizontalAlignment? tooltipHorizontalAlignment,
- double? tooltipHorizontalOffset,
- double? maxContentWidth,
- GetScatterTooltipItems? getTooltipItems,
- bool? fitInsideHorizontally,
- bool? fitInsideVertically,
- double? rotateAngle,
- BorderSide? tooltipBorder,
- GetScatterTooltipColor? getTooltipColor,
if ScatterTouchData.handleBuiltInTouches is true,
ScatterChart shows a tooltip popup on top of spots automatically when touch happens,
otherwise you can show it manually using ScatterChartData.showingTooltipIndicators.
Tooltip shows on top of spots, 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
.
Content of the tooltip will provide using getTooltipItems
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, ScatterChart 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
ScatterTouchTooltipData({
double? tooltipRoundedRadius,
EdgeInsets? tooltipPadding,
FLHorizontalAlignment? tooltipHorizontalAlignment,
double? tooltipHorizontalOffset,
double? maxContentWidth,
GetScatterTooltipItems? getTooltipItems,
bool? fitInsideHorizontally,
bool? fitInsideVertically,
double? rotateAngle,
BorderSide? tooltipBorder,
GetScatterTooltipColor? getTooltipColor,
}) : tooltipRoundedRadius = tooltipRoundedRadius ?? 4,
tooltipPadding = tooltipPadding ??
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
tooltipHorizontalAlignment =
tooltipHorizontalAlignment ?? FLHorizontalAlignment.center,
tooltipHorizontalOffset = tooltipHorizontalOffset ?? 0,
maxContentWidth = maxContentWidth ?? 120,
getTooltipItems = getTooltipItems ?? defaultScatterTooltipItem,
fitInsideHorizontally = fitInsideHorizontally ?? false,
fitInsideVertically = fitInsideVertically ?? false,
rotateAngle = rotateAngle ?? 0.0,
tooltipBorder = tooltipBorder ?? BorderSide.none,
getTooltipColor = getTooltipColor ?? defaultScatterTooltipColor,
super();