axisLabelFormatter property
Called while rendering each axis label in the chart.
Provides label text, axis name, orientation of the axis, trimmed text and
text styles such as color, font size, and font weight to the user using
the AxisLabelRenderDetails
class.
You can customize the text and text style using the ChartAxisLabel
class
and can return it.
Defaults to null
.
Widget build(BuildContext context) {
return Container(
child: SfCartesianChart(
primaryXAxis: CategoryAxis(
axisLabelFormatter:
(AxisLabelRenderDetails details) => axis(details),
),
)
);
}
ChartAxisLabel axis(AxisLabelRenderDetails details) {
return ChartAxisLabel('axis Label', details.textStyle);
}
Implementation
final ChartLabelFormatterCallback? axisLabelFormatter;