alignment property Null safety

ChartAlignment alignment
final

Aligns the axis title.

It is applicable for both vertical and horizontal axes.

  • ChartAlignment.near, moves the axis title to the beginning of the axis

  • ChartAlignment.far, moves the axis title to the end of the axis

  • ChartAlignment.center, moves the axis title to the center position of the axis.

Defaults to ChartAlignment.center.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           primaryXAxis: NumericAxis(
                title: AxisTitle(
                  text: 'Axis Title',
                  alignment: ChartAlignment.far,
                )
               ),
       )
   );
}

Implementation

final ChartAlignment alignment;