defaultLineTooltipItem function

List<LineTooltipItem> defaultLineTooltipItem(
  1. List<LineBarSpot> touchedSpots
)

Default implementation for LineTouchTooltipData.getTooltipItems.

Implementation

List<LineTooltipItem> defaultLineTooltipItem(List<LineBarSpot> touchedSpots) =>
    touchedSpots.map((LineBarSpot touchedSpot) {
      final textStyle = TextStyle(
        color: touchedSpot.bar.gradient?.colors.first ??
            touchedSpot.bar.color ??
            Colors.blueGrey,
        fontWeight: FontWeight.bold,
        fontSize: 14,
      );
      return LineTooltipItem(touchedSpot.y.toString(), textStyle);
    }).toList();