selectionGesture property

ActivationMode selectionGesture
final

Data points or series can be selected while performing interaction on the chart.

It can also be selected at the initial rendering using this property.

Defaults to [].

Widget build(BuildContext context) {
   return Container(
       child: SfPyramidChart(
          series: PyramidSeries<ChartData, String>(
                 initialSelectedDataIndexes: <int>[1,0],
                 selectionSettings: SelectionSettings(
                   selectedColor: Colors.red,
                   unselectedColor: Colors.grey
                 ),
               ),
       ));
}

Gesture for activating the selection.

Selection can be activated in tap, double tap, and long press.

Defaults to ActivationMode.tap.

Also refer ActivationMode

Widget build(BuildContext context) {
   return Container(
       child: SfPyramidChart(
          selectionGesture: ActivationMode.singleTap,
          series: PyramidSeries<ChartData, String>(
                 selectionSettings: SelectionSettings(
                   selectedColor: Colors.red,
                   unselectedColor: Colors.grey
                 ),
               ),
       ));
}

Implementation

///Gesture for activating the selection.
///
/// Selection can be activated in tap, double tap, and long press.
///
///Defaults to `ActivationMode.tap`.
///
///Also refer [ActivationMode]
///
///```dart
///Widget build(BuildContext context) {
///    return Container(
///        child: SfPyramidChart(
///           selectionGesture: ActivationMode.singleTap,
///           series: PyramidSeries<ChartData, String>(
///                  selectionSettings: SelectionSettings(
///                    selectedColor: Colors.red,
///                    unselectedColor: Colors.grey
///                  ),
///                ),
///        ));
///}
///```
final ActivationMode selectionGesture;