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 SfCartesianChart(
    legend: Legend(
      isVisible: true,
      title: ChartTitle(
        text: 'Legend title',
        alignment: ChartAlignment.near
      )
    )
  );
}

Implementation

final ChartAlignment alignment;