yAxisName property Null safety

String? yAxisName
final

Specifies the y-axis name to the annotation that should be bound.

Defaults to ‘’.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           series: <ChartSeries<SalesData, num>>[
               LineSeries<SalesData, num>(
                   yAxisName: 'Gold'
               ),
             ],
           annotations: <CartesianChartAnnotation>[
               CartesianChartAnnotation(
                   widget: Container(
                   child: const Text('Annotation')),
                   x: 3,
                   y: 60,
                   yAxisName: 'Gold'
             ),
       )
   );
}

Implementation

final String? yAxisName;