---
title: "Pie chart widgets"
canonical: "https://docs.devo.com/space/latest/95207647/Pie%20chart%20widgets"
format: markdown
---
> Macro (toc)

## About pie chart widgets

<span style="color: #222222">These are useful when you need to do a part-to-whole data analysis and have only a small number of categories to compare. </span><span style="color: #000000">The pie chart is a statistical graph intended to plot numerical proportions</span><span style="color: #222222">. The pie is divided into slices representing the proportion of each value in a data series.</span>

![image](media://606aa6e6-1ec5-44f3-b1c5-5a5af8979859)

## What data do I need for this widget?

For a more accurate analysis, the source query must contain grouped events and aggregated values. If there are several grouping arguments and aggregations, you can select the one to use in the widget's visual settings.

If the source query does not group and aggregate, it must contain at least two fields, one of them with numeric values. If there is more than one, you can select the necessary one in the widget's visual settings.

## Widget settings

To edit the widget settings, you must first activate the [Edit mode](https://devodocs.atlassian.net/wiki/spaces/latest/pages/95207321).

Click the widget title bar to open its settings. Alternatively, the settings are accessible via the **Ellipsis** icon → **Properties**. The widget settings are contained in three tabs, **Data,** **Visual, **and **Raw**.

The settings in the **Data **and **Raw** tabs are described in the [Create a widget article](https://devodocs.atlassian.net/wiki/spaces/latest/pages/95207411). These are the **Visual** settings for the pie chart:

| **Category** | **Setting** | **Description** |
| --- | --- | --- |
| **Fields** | **Aggregation** | Value that determines the proportion of each slice of the pie. It must be a number. |
| **Series** | Select the data series that you want to display in the pie chart. |
| **General** | **Limit slices** | Limits the number of slices to show, grouping the rest of the categories in a single group. |
| **Sort legend** | This is the maximum number of slices to plot on the chart. This is done to avoid overcrowding and to maintain readability.<br>- **Total values: **choose between total values or series name for the limit slices.<br>- **Ascending/Descending: **select whether to sort from ascending or descending order. |
| **Legend** | **Horizontal alignment** | Select the horizontal alignment of the legend that indicates the different series. Choose *center*, *right* or *left*. |
| **Vertical alignment** | Select the vertical alignment of the legend. Choose *bottom*, *top *or *middle* |
| **Layout** | Select the layout alignment of the legend. Choose *horizontal* or *vertical*. |
| **Size** | The range of values ​​(from 16px to 320px). |

## Tips for using a pie chart widget

Here are a few tips to get the most out of your pie chart:

- Move your mouse over any slice of the pie to display a tooltip that contains detailed information.
- Hover over a data series in the chart legend to dim the rest of them down in the chart or click it to hide it or show it.
- To emphasize an individual slice, you can pull it away from the chart by clicking it (hold [Ctrl] to pull several slices). Click the slice again to move it back to its original location.

![image](media://c04178dc-b1c0-483f-b945-5bad22dbb183)

## Query example

This is the source query used and <span style="color: #172b4d">the fields mapped </span>to generate the widget shown above<span style="color: #172b4d">:</span>