xAxisName property Null safety

String? xAxisName
final

Name of the x-axis to bind the series.

Defaults to ‘’

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
            axes: <ChartAxis>[
                       NumericAxis(
                           plotOffset: 0,
                           majorGridLines: MajorGridLines(color: Colors.transparent),
                           opposedPosition: true,
                           name: 'xAxis1',
                           axisTitle: AxisTitle(
                               text: 'China - Growth'))
                     ],
           series: <BubbleSeries<BubbleColors, num>>[
                  BubbleSeries<BubbleColors, num>(
                      dataSource: chartData,
                      xAxisName: 'xAxis1',
                 ),
            ],
       ));
}
final List<BubbleColors> chartData = <BubbleColors>[
   BubbleColors(92.2, 7.8, 1.347, const Color.fromRGBO(0, 0, 255, 1)),
   BubbleColors(74, 6.5, 1.241, const Color.fromRGBO(255, 0, 0, 1)),
   BubbleColors(90.4, 6.0, 0.238, const Color.fromRGBO(255, 100, 102, 1)),
   BubbleColors(99.4, 2.2, 0.197, const Color.fromRGBO(122, 100, 255, 1)),
];

Implementation

final String? xAxisName;