offset property

Offset? offset
final

Moves the data label vertically or horizontally from its position.

If you wish to reposition the data label, you can achieve using this property. You can move the data label in both vertical and horizontal direction from its position. It takes the logical pixel value for x and y values as input.

Positive value for x, moves the data label to right and negative value moves to left. Positive value for y, moves the data label upwards and negative value moves downwards.

These are applied to the data label's final position. i.e. after considering the position and alignment values.

Also refer labelAlignment.

Note: This property is only applicable for Cartesian charts and not for Circular, Pyramid and Funnel charts.

Defaults to null.

Widget build(BuildContext context) {
  return SfCartesianChart(
    series: <SplineSeries<SalesData, num>>[
      SplineSeries<SalesData, num>(
        dataLabelSettings: DataLabelSettings(
          isVisible: true,
          offset: Offset(200,200)
        )
      ),
    ],
  );
}

Implementation

final Offset? offset;