onTooltipRender property Null safety

ChartTooltipCallback? onTooltipRender
final

Occurs while tooltip is rendered. You can customize the position and header. Here, you can get the text, header, point index, series, x and y-positions.

TooltipBehavior _tooltipBehavior;

@override
void initState() {
 _tooltipBehavior = TooltipBehavior( enable: true);
 super.initState();
}

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           tooltipBehavior: _tooltipBehavior,
           onTooltipRender: (TooltipArgs args) => tool(args)
       )
   );
}
void tool(TooltipArgs args) {
  args.locationX = 30;
}

Implementation

final ChartTooltipCallback? onTooltipRender;