tooltipInfo method
TooltipInfo?
tooltipInfo(
{ - Offset? position,
- int? pointIndex,
})
override
Implementation
@override
TooltipInfo? tooltipInfo({Offset? position, int? pointIndex}) {
final ChartPoint<D> point = ChartPoint<D>(
x: series.circularXValues[currentSegmentIndex],
y: series.circularYValues[currentSegmentIndex]);
final Offset location = calculateOffset((_startAngle + _endAngle) / 2,
(_innerRadius + _outerRadius) / 2, _center);
final TooltipPosition? tooltipPosition =
series.parent?.tooltipBehavior?.tooltipPosition;
final Offset preferredPos = tooltipPosition == TooltipPosition.pointer
? series.localToGlobal(position ?? location)
: series.localToGlobal(location);
return ChartTooltipInfo<T, D>(
primaryPosition: preferredPos,
secondaryPosition: preferredPos,
text: series.tooltipText(point),
header: '',
data: series.dataSource![currentSegmentIndex],
point: point,
series: series.widget,
renderer: series,
seriesIndex: series.index,
segmentIndex: currentSegmentIndex,
pointIndex: currentSegmentIndex,
);
}