xAxisName property

String? xAxisName
final

Specifies the x-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>(
                   xAxisName: 'Gold'
               ),
             ],
           annotations: <CartesianChartAnnotation>[
               CartesianChartAnnotation(
                   child: Container(
                   child: const Text('Empty data')),
                   coordinateUnit: CoordinateUnit.point,
                   region: AnnotationRegion.chartArea,
                   x: 3.5,
                   y: 60,
                   xAxisName: 'Gold'
              ),
            ],
       ));
}

Implementation

final String? xAxisName;