onTrendlineRender property Null safety

ChartTrendlineRenderCallback? onTrendlineRender
final

Occurs when the trendline is rendered. Here, you can get the legend’s text, shape, series index, and point index of circular series.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           onTrendlineRender: (TrendlineRenderArgs args) => trendline(args)
       ));
}
void trendline(TrendlineRenderArgs args) {
  args.seriesIndex = 2;
}

Implementation

final ChartTrendlineRenderCallback? onTrendlineRender;