multiLevelLabels property

List<DateTimeCategoricalMultiLevelLabel>? multiLevelLabels
final

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: DateTimeCategoryAxis(
        multiLevelLabels: <DateTimeCategoricalMultiLevelLabel>[
          DateTimeCategoricalMultiLevelLabel(
             start: DateTime(2010, 1, 1),
            end: DateTime(2010, 2, 1),
            text: 'First'
          ),
          DateTimeCategoricalMultiLevelLabel(
            start: DateTime(2011, 1, 1),
            end: DateTime(2011, 2, 1),
            text: 'Second'
          )
        ]
      )
    )
  );
}

Implementation

final List<DateTimeCategoricalMultiLevelLabel>? multiLevelLabels;