tooltipFormatter property

SparkChartTooltipCallback<String>? tooltipFormatter

Callback that gets triggered when a trackball tooltip text is created.

The TooltipFormatterDetails is passed as an argument and it provides the closest data point x value, y value, and the tooltip text.

The string returned from this call back will be displayed as tooltip text.

Defaults to null.

String handleTooltipFormatter(TooltipFormatterDetails details) {
 return details.y.toStringAsFixed(0) + 'cm';

Widget build(BuildContext context) {
 return Scaffold(
   body: Center(
    child: SfSparkAreaChart(
         SparkChartTrackball(tooltipFormatter: handleTooltipFormatter)


final SparkChartTooltipCallback<String>? tooltipFormatter;