> For the complete documentation index, see [llms.txt](https://flutter.wednesday.is/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flutter.wednesday.is/charts/guides/radial-charts/charts/pie-and-donut-chart/interactions.md).

# Interactions

<figure><img src="/files/tjxqfVy4CUHdjmsbfCM3" alt=""><figcaption></figcaption></figure>

## Listening to interactions on Pie Chart

The `PieInteractionEvents` class provides callbacks for all interactions happening on `PieChart`.&#x20;

Look at the common [Interactions](/charts/guides/interactions.md) guide to know about all the common interaction features.

Here we will see `PieChart` specific interaction details.

To start listening for interactions, provide an instance of `PieInteractionEvents` to the `interactionEvents` parameter on `PieSeries`.&#x20;

```dart
PieChart(
    ...
    data: PieSeries(
        ...
        interactionEvents: PieInteractionEvents(
          isEnabled: true,
          onTap: (result) {
             ...
          },
          onDrag: (result) {
            // Update the data and call setState so that the chart 
            // will re-render based on new data.
            setState(() {
              _interactionIndex = result.sliceDataIndex;
            });
          }),
          ...
      )
  );
   
```

## Pie Interaction Result

In addition to common parts described in [Interactions](/charts/guides/interactions.md), the `PieIntractionResult` has the details of the slice for which the interaction was triggered.

Every interaction callback for `PieInteractionEvents` will receive an instance of `PieInteractionResult`.

In addition to `localOffset` and `TouchInteractionType`, `PieInteractionResult` has

| Properties       | Description                                    |
| ---------------- | ---------------------------------------------- |
| `slice`          | The `SliceData` that matches this interaction. |
| `sliceDataIndex` | The index of `slice` in `PieSeries` data.      |
