offset property

Offset? offset
final

Places the legend in custom position.

If the offset has been set, the legend is moved from its actual position. For example, if the position is top, then the legend will be placed in the top but in the position added to the actual top position.

Also, the legend will not take a dedicated position for it and will be drawn on the top of the chart's plot area.

Widget build(BuildContext context) {
  return SfCartesianChart(
    legend: Legend(
      isVisible: true,
      offset: Offset(20,40)
    )
  );
}

Implementation

final Offset? offset;