enable property

bool enable
final

Enables or disables the selection.

By enabling this, each data point or series in the chart can be selected.

Defaults to false.

late SelectionBehavior selectionBehavior;

void initState() {
  selectionBehavior = SelectionBehavior(
    enable: true
  );
  super.initState();
}

Widget build(BuildContext context) {
  return SfCartesianChart(
    series: <BarSeries<SalesData, num>>[
      BarSeries<SalesData, num>(
        selectionBehavior: selectionBehavior
      ),
    ],
  );
}

Implementation

final bool enable;