alignment property Null safety

ChartAlignment alignment
final

Alignment of the legend.

Alignment will work if the legend width is greater than the total legend item's width.

Defaults to ChartAlignment.center.

Also refer ChartAlignment.

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

Implementation

final ChartAlignment alignment;