# Exploding Pie/Donut Chart Series On Click

## Environment

<table>
	<tbody>
		<tr>
			<td>Product Version</td>
			<td>9.0.0</td>
		</tr>
		<tr>
			<td>Product</td>
			<td>Progress® KendoReact Chart</td>
		</tr>
	</tbody>
</table>

## Description

How can I make the Pie or Donut Chart series explode when clicking them?

## Solution

To achieve click-to-expand functionality in a React pie chart you should:

1. Handle the [`seriesClick`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartprops#onseriesclick) event:

```html
<Chart onSeriesClick="{onSeriesClick}"> </Chart>
```

2. Within the event handler function, toggle the [`explodeField`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartseriesitemprops#explodefield) property and update the Chart data by reference to re-render the Chart.

```jsx
const onSeriesClick = (event) => {
    const newData = data.map((item) => {
        item.exploded = item === event.dataItem ? !item.exploded : false;
        return item;
    });

    setData(newData);
};
```

The following example demonstrates the full implementation of the suggested approach.

[Demo Source](https://demos.telerik.com/kendo-react-ui/knowledge-base/charts/chart-click-to-expand/source.txt)

## See Also

* [React Charts Documentation](https://www.telerik.com/kendo-react-ui/components/charts/)
* [Chart SeriesItem Component](https://www.telerik.com/kendo-react-ui/components/charts/api/ChartSeriesItem/)
* [Handling Events in React Charts](https://www.telerik.com/kendo-react-ui/components/charts/chart-elements/events/)
