builder property

ChartTrackballBuilder? builder
final

Builder of the trackball tooltip.

Add any custom widget as the trackball template.

If the trackball display mode is groupAllPoints or nearestPoint it will called once and if it is floatAllPoints, it will be called for each point.

Defaults to null.

late TrackballBehavior trackballBehavior;

void initState() {
  trackballBehavior = TrackballBehavior(
    enable: true,
    builder: (BuildContext context, TrackballDetails trackballDetails) {
      return Container(
        width: 70,
        decoration:
          const BoxDecoration(color: Color.fromRGBO(66, 244, 164, 1)),
        child: Text('${trackballDetails.point?.cumulative}')
      );
    }
  );
  super.initState();
}

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

Implementation

final ChartTrackballBuilder? builder;