tooltipAlignment property

ChartAlignment tooltipAlignment
final

Alignment of the trackball tooltip.

The trackball tooltip can be aligned at the top, bottom, and center position of the chart.

Note: This is applicable only when the tooltipDisplayMode property is set to TrackballDisplayMode.groupAllPoints.

Defaults to ChartAlignment.center

late TrackballBehavior trackballBehavior;

void initState() {
  trackballBehavior = TrackballBehavior(
    enable: true,
    tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
    tooltipAlignment: ChartAlignment.far
  );
  super.initState();
}

Widget build(BuildContext context) {
  return SfCartesianChart(
    trackballBehavior: trackballBehavior
  );
}

Implementation

final ChartAlignment tooltipAlignment;