multiLevelLabels property Null safety

List<ChartMultiLevelLabel>? multiLevelLabels

Provides the option to group the axis labels. You can customize the start, end value of a multi-level label, text, and level of the multi-level labels.

The start and end values for the category axis need to be string type, in the case of date-time or date-time category axes need to be date-time and in the case of numeric or logarithmic axes needs to be double.

Defaults to null.

Widget build(BuildContext context) {
  return Container(
    child: SfCartesianChart(
      primaryXAxis: NumericAxis(
        multiLevelLabels: const <NumericMultiLevelLabel>[
            start: 0,
            end: 2,
            text: 'First'
            start: 2,
            end: 4,
            text: 'Second'


// ignore: always_specify_types, strict_raw_type
final List<ChartMultiLevelLabel>? multiLevelLabels;