# Drilldown Charts

The KendoReact Charts supports drilldown functionality for exploring data.

The drilldown function allows users to click on a point (bar, pie segment, etc.) in order to navigate to a different view.
The new view usually contains finer grained data about the selected item, like breakdown by product of the selected category.

<CtaPanelOverview></CtaPanelOverview>

The view hierarchy is displayed in a breadcrumb for easy navigation back to previous views.

## Getting Started

To configure a chart series for drilldown:

* Set the [`drilldownField`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartseriesitemprops#drilldownfield) prop to a field that contains the drilldown value. For categorical charts, this is typically the category field.
* Create a component that will create the [`ChartSeriesItem`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartseriesitem) for the detail series. The component should pass all props to the series.
* Set the [`drilldownSeriesFactory`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartseriesitemprops#drilldownseriesfactory) prop to the component that will create the series.
* Add a [`ChartBreadcrumb`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartbreadcrumb) component.
* Add a state variable to store the [`ChartDrilldownState`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartdrilldownstate).
* Add a shared handler for the Chart [`onDrilldown`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartprops#ondrilldown) event and the Breadcrumb [`onDrilldownStateChange`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartbreadcrumbprops) event. Set the state variable to the [`nextState`](https://www.telerik.com/kendo-react-ui/components/charts/api/drilldownevent#nextstate) passed to the handler.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/drilldown/overview/func/source.txt)

## Adding Drilldown Levels

To add a drilldown level, set the [`drilldownSeriesFactory`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartseriesitemprops#drilldownseriesfactory) prop on the parent series to a component that returns a [`ChartSeriesItem`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartseriesitem) for the drilldown series. The component must pass all props to the `ChartSeriesItem` component.

The following example demonstrates a Drilldown Chart with 3 levels.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/drilldown/multi-level/func/source.txt)

## Customizing the Breadcrumb Root Item

To customize the root item of the Chart Breadcrumb, set the [`rootItem`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartbreadcrumbprops#rootitem) prop to an object implementing the Breadcrumb [`DataModel`](https://www.telerik.com/kendo-react-ui/components/layout/api/datamodel) interface.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/drilldown/breadcrumb-custom-root/func/source.txt)

## Custom Navigation

To implement a custom drilldown navigation:

* Add a navigation component, such as the [`Breadcrumb`](https://www.telerik.com/kendo-react-ui/components/layout/breadcrumb).
* Add a state variable to store the [`ChartDrilldownState`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartdrilldownstate).
* Update the navigation with the current dropdown level in the [`onDrilldown`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartprops#ondrilldown) handler for the Chart.
* Update the drilldown state after navigation.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/drilldown/custom-navigation/func/source.txt)

## Suggested Links

* [Breadcrumb - Overview](https://www.telerik.com/kendo-react-ui/components/layout/breadcrumb)
* [API Reference of the Charts](https://www.telerik.com/kendo-react-ui/components/charts/api)
