alignment property

ChartAlignment alignment
final

Alignment of the legend.

Alignment will work if the legend width is greater than the total legend items’ width.

Defaults to ChartAlignment.center

Also refer ChartAlignment

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           legend: Legend(
              isVisible: true,
              alignment: ChartAlignment.near)
       ));
}

Implementation

final ChartAlignment alignment;