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(
                   child: Container(
                   child: const Text('Empty data')),
                   coordinateUnit: CoordinateUnit.point,
                   region: AnnotationRegion.chartArea,
                   x: 3.5,
                   y: 60,
                   yAxisName: 'Diamond'
              ),
            ],
       ));
}

Implementation

final String? yAxisName;