LineTouchTooltipData class

Holds representation data for showing tooltip popup on top of spots.


LineTouchTooltipData({double tooltipRoundedRadius = 4, EdgeInsets tooltipPadding = const EdgeInsets.symmetric(horizontal: 16, vertical: 8), double tooltipMargin = 16, FLHorizontalAlignment tooltipHorizontalAlignment =, double tooltipHorizontalOffset = 0, double maxContentWidth = 120, GetLineTooltipItems getTooltipItems = defaultLineTooltipItem, GetLineTooltipColor getTooltipColor = defaultLineTooltipColor, bool fitInsideHorizontally = false, bool fitInsideVertically = false, bool showOnTopOfTheChartBoxArea = false, double rotateAngle = 0.0, BorderSide tooltipBorder = BorderSide.none})
if LineTouchData.handleBuiltInTouches is true, LineChart shows a tooltip popup on top of spots automatically when touch happens, otherwise you can show it manually using LineChartData.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, or If you want to have a bottom margin, set tooltipMargin. 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, LineChart 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.


fitInsideHorizontally bool
Forces the tooltip to shift horizontally inside the chart, if overflow happens.
fitInsideVertically bool
Forces the tooltip to shift vertically inside the chart, if overflow happens.
getTooltipColor GetLineTooltipColor
getTooltipItems GetLineTooltipItems
Retrieves data for showing content inside the tooltip.
hashCode int
The hash code for this object.
no setterinherited
maxContentWidth double
Restricts the tooltip's width.
props List<Object?>
Used for equality check, see EquatableMixin.
no setter
rotateAngle double
Controls the rotation of the tooltip.
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showOnTopOfTheChartBoxArea bool
Forces the tooltip container to top of the line, default 'false'
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
tooltipBorder BorderSide
The tooltip border color.
tooltipHorizontalAlignment FLHorizontalAlignment
Controls showing tooltip on left side, right side or center aligned with spot, default is center
tooltipHorizontalOffset double
Applies horizontal offset for showing tooltip, default is zero.
tooltipMargin double
Applies a bottom margin for showing tooltip on top of rods.
tooltipPadding EdgeInsets
Applies a padding for showing contents inside the tooltip.
tooltipRoundedRadius double
Sets a rounded radius for the tooltip.


noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.