A pie chart is a graph that displays data as segments of a circle proportional to the whole, making it look like a sliced pie. Each slice corresponds to a value or measurement.
Pie charts display reduced series, or values in a series, from one or more queries, as they relate to each other, in the form of slices of a pie. The arc length, area and central angle of a slice are all proportional to the slices value, as it relates to the sum of all values. This type of chart is best used when you want a quick comparison of a small set of values in an aesthetically pleasing form.
The pie chart visualization is ideal when you have data that adds up to a total and you want to show the proportion of each value compared to other slices, as well as to the whole of the pie.
You can use a pie chart if you need to compare:
- Browser share distribution in the market
- Incident causes per category
- Network traffic sources
- User demographics
## Configure a pie chart visualization
@ -35,6 +44,60 @@ The following video guides you through the creation steps and common customizati
{{<docs/playtitle="Grafana Bar Charts and Pie Charts"url="https://play.grafana.org/d/ktMs4D6Mk/">}}
## Supported data formats
The pie chart is different from other visualizations in that it will only display one pie, regardless of the number of datasets, fields, or records queried in it.
To create a pie chart visualization, you need a dataset containing a set of numeric values either in rows, columns, or both.
### Example - One row
The easiest way to provide data for a pie chart visualization is in a dataset with a single record (or row) containing the fields (or columns) that you want in the pie, as in the following example. The default settings of the pie chart visualization automatically display each column as a slice of the pie.
| Value1 | Value2 | Value3 | Optional |
| ------ | ------ | ------ | -------- |
| 5 | 3 | 2 | Sums10 |

### Example - Multiple rows
If you need to use numeric data that's in multiple rows, the default **Show** parameter of the visualization [Value options](#value-options) is set to **Calculate** and use data from the last row.
| Value | Label |
| ----- | ------ |
| 5 | Value1 |
| 3 | Value2 |
| 2 | Value3 |

By default, the visualization is configured to [calculate](#value-options) a single value per column or series and to display only the last row of data.
To allow values in multiple rows to be displayed, change the **Show** setting in the [Value options](#value-options) from **Calculate** to **All values**.

### Example - Multiple rows and columns
If your dataset contains multiple rows and columns with numeric data, by default only the last row's values are summed.
| Value1 | Value2 | Value3 | Optional |
| ------ | ------ | ------ | -------- |
| 5 | 3 | 2 | Sums10 |
| 10 | 6 | 4 | Sums20 |
| 20 | 8 | 2 | Sums30 |

If you want to display all the cells, change the **Show** setting in the [Value options](#value-options) from **Calculate** to **All values**. This also labels the elements by concatenating all the text fields (if you have any) with the column name.

If you want to display only the values from a given field (or column), once the **Show** setting in the [Value options](#value-options) is set to **All values**, set the **Fields** option to the column you wish to sum in the display. The value labels are also concatenated as indicated before.
