onAxisLabelTapped property

ChartAxisLabelTapCallback? onAxisLabelTapped
final

Occurs when tapping the axis label. Here, you can get the appropriate axis that is tapped and the axis label text.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           onAxisLabelTapped: (AxisLabelTapArgs args) => axis(args),
       )
   );
}

void axis(AxisLabelTapArgs args) {
  print(args.text);
}

Implementation

final ChartAxisLabelTapCallback? onAxisLabelTapped;