multiLevelLabels property
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: CategoryAxis(
multiLevelLabels: <CategoricalMultiLevelLabel>[
CategoricalMultiLevelLabel(
start: '2',
end: '4',
text: 'First'
),
CategoricalMultiLevelLabel(
start: '5',
end: '7',
text: 'Second'
)
]
)
)
);
}
Implementation
final List<CategoricalMultiLevelLabel>? multiLevelLabels;