alignment property

ChartAlignment alignment
final

Alignment of the legend title.

Used to change the alignment of the title text.

It can be ChartAlignment.near,ChartAlignment.center, or ChartAlignment.far.

Defaults to ChartAlignment.center.

Also refer ChartAlignment

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           legend: Legend(
              isVisible: true,
              title: ChartTitle(
                   text: 'Countries',
                   alignment: ChartAlignment.center
           ))
       ));
}

Implementation

final ChartAlignment alignment;