unselectedOpacity property

double unselectedOpacity
final

Opacity of the unselected series or data point.

Defaults to 0.5.

late SelectionBehavior selectionBehavior;

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

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

Implementation

final double unselectedOpacity;