# Angular Pie Chart

Pie charts are circular charts that display data in the form of one-series sectors of a two-dimensional circle. Each sector represents a proportion of the whole, making it easy to visualize part-to-whole relationships and compare different categories.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/series-types/pie/overview/source.txt)

## Binding to Data

You can bind the Pie chart series to an array through the [`data`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/seriesitemcomponent#data) property in three formats:

* Binding to numbers—Use a simple array of numeric values.

  ```ts
  public data: number[] = [40, 30, 20, 10];
  ```

* Binding to arrays—Use arrays of `[value, category]` pairs.

  ```ts
  public data: [number, string][] = [
      [40, 'Apples'],
      [30, 'Oranges'],
      [20, 'Bananas'],
      [10, 'Grapes']
  ];
  ```

* Binding to objects—Use an array of objects with custom properties.

  ```ts
  public data: Array<{ value: number; category: string; color?: string }> = [
      { value: 40, category: 'Apples', color: '#ff6358' },
      { value: 30, category: 'Oranges', color: '#ffd246' },
      { value: 20, category: 'Bananas', color: '#28b4c8' },
      { value: 10, category: 'Grapes', color: '#2d73f5' }
  ];
  ```

  When binding to objects, specify which properties contain the data through the following field mappings:

  | Property                                                                                                                    | Data type | Required | Description                                                                             |
  | --------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | --------------------------------------------------------------------------------------- |
  | [`field`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/seriesitemcomponent#field)                 | `string`  | Yes\*    | The property name that contains the numeric value (\*required when binding to objects). |
  | [`categoryField`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/seriesitemcomponent#categoryfield) | `string`  | No       | The property name that contains the category with `string`, `date`, or `number` values. |
  | [`colorField`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/seriesitemcomponent#colorfield)       | `string`  | No       | The property name that contains the color with `string` values.                         |

The following example demonstrates how to bind the Pie chart series to data using object models.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/series-types/pie/data-binding/source.txt)

## Configuring Pie Chart Labels

The Pie Chart provides flexible label configuration options to display data effectively. You can control label positioning, prevent content clipping, and format values to enhance readability.

### Auto-Fit

Labels can extend beyond the chart boundaries and get clipped when the chart size is constrained. To prevent label clipping, set the [`autoFit`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/seriesitemcomponent#autofit) property to `true`, which automatically adjusts label positions to fit within the chart area.

The following example demonstrates how to enable the auto-fit feature for Pie chart labels. Toggle the checkbox to see how it affects label visibility.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/series-types/pie/autofit/source.txt)

### Alignment

The Pie Chart supports two label alignment modes to optimize space usage and readability. Choose between circular positioning around the chart or columnar arrangement on the sides.

The available alignment modes are:

* `"circle"` (default)—The labels are positioned in a circle around the chart.
* `"column"`—The labels are positioned in columns to the left and right of the chart.

To select the alignment mode, set the [`align`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/serieslabelscomponent#align) property of the Series Labels.

The following example demonstrates how to configure label alignment.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/series-types/pie/label-align/source.txt)

### Percentage Values

By default, Pie chart labels display the raw data values from your dataset. To show how each segment relates to the whole, you can format labels as percentages.

To display percentage values, provide a custom callback function to the [`content`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/serieslabelscomponent#content) property of the Series Labels. Use the `formatNumber` method from the [`@progress/kendo-angular-intl`](https://www.npmjs.com/package/@progress/kendo-angular-intl) package to format values as percentages.

The following example demonstrates how to display percentage labels.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/series-types/pie/percentage-labels/source.txt)

## Exploding Pie Segments

You can visually separate specific pie segments from the rest of the chart to highlight them. Use the [`explodeField`](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api/seriesitemcomponent#explodefield) property to specify which data field contains the boolean value that determines if a segment is exploded.

When a segment is exploded, it appears separated from the pie with a small gap, drawing attention to that specific data point. This is useful for emphasizing important categories or values in your data.

The following example demonstrates how to explode segments in the Angular Pie Chart.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/series-types/pie/explode-segments/source.txt)

## Support and Learning Resources

* [Pie Chart Homepage](https://www.telerik.com/kendo-angular-ui/charts#pie-chart)
* [Getting Started with the Kendo UI for Angular Chart](https://www.telerik.com/kendo-angular-ui-develop/components/charts/installation/getting-started)
* [API Reference of the Charts](https://www.telerik.com/kendo-angular-ui-develop/components/charts/api)
* [Donut Charts](https://www.telerik.com/kendo-angular-ui-develop/components/charts/series-types/donut)
* [Getting Started with Kendo UI for Angular (Online Guide)](https://www.telerik.com/kendo-angular-ui-develop/components/getting-started)
* [Getting Started with Kendo UI for Angular (Video Tutorial)](https://www.telerik.com/campaigns/kendo-ui/using-kendo-ui-with-angular-video-tutorial)
* [Video Courses](https://www.telerik.com/kendo-angular-ui-develop/components/getting-started/video-onboarding)
* [Chart Forum](https://www.telerik.com/forums/kendo-angular-ui?tagId=256)
* [Before You Start: All Things Angular (Telerik Blog Post)](https://www.telerik.com/blogs/all-things-angular)
* [Knowledge Base](https://www.telerik.com/kendo-angular-ui-develop/components/knowledge-base)

## Additional Resources

* [Angular Blogs](https://www.telerik.com/blogs/tag/kendo-ui-for-angular)
* [Angular Videos](https://www.telerik.com/videos/kendo-angular-ui)
* [Kendo UI for Angular Roadmap](https://www.telerik.com/support/whats-new/kendo-angular-ui/roadmap)
