Pie chart

Pie charts group data into slices to visualize part-to-whole relationships. The chart represents the total (either count or sum) of all categories, and each slice is the proportion of a single category compared to the whole. Visualizing data as proportions helps you to understand the magnitudes of each category relative to each other and to the total.

Example

Create a pie chart to visualize the proportions of crime types for incidents within a city.

  • Category—Crime type
  • Aggregation—Count
  • Numeric field—None
  • Display—Both (value and percentage)
Crime incidents by type

Data

The Data tab Data configurations include the variables that are used to create the pie chart.

Variables

Pie charts display unique categories as slices. The size of the slices correspond to the proportion of each category to the whole. You can create slices in a pie chart by setting a Category value or by selecting multiple Numeric fields values.

If a field is specified for Category, the slices represent the unique values in the field and are aggregated by count (the proportion for each slice is calculated using the total number of times each unique category appears in the category field). The Category variable must be a string or integer.

A Numeric fields value is added by clicking Select numeric fields. When a Category variable and a Numeric fields variable are both specified, slices are aggregated by sum (the sum of each unique value is calculated using the numeric field, then the sums are used to calculate the proportion for each slice).

If no Category variable is specified, slices are created using multiple numeric fields. The pie chart displays each of the chosen fields as an individual slice. Slices are aggregated by the sum of the numeric field.

Labels

You can turn on labels that display the value of each slice by enabling Show data labels.

Sort order

Pie charts are automatically sorted counterclockwise by value. The sorting can be changed using the Sort order parameter. The following sort options are available for pie charts:

  • Label clockwise—Categories are arranged alphabetically in clockwise order, starting at the top center of the chart.
  • Label counter-clockwise—Categories are arranged alphabetically in counterclockwise order, starting at the top center of the chart.
  • Value clockwise—Categories are arranged by value in clockwise order, starting at the top center of the chart.
  • Value counter-clockwise—Categories are arranged by value in counterclockwise order, starting at the top center of the chart.

Slices

The Slices tab Slices configurations determine how the slices on the pie chart are displayed, including the grouping, labels, and slice colors.

Settings

You can change the size of the donut hole using the Donut size parameter. The default donut size is 0. You can increase or decrease the Donut size value to increase or decrease the size of the hole.

You can change the threshold for creating individual slices using the Grouping (%) parameter. The default grouping percent is 0, meaning all categories or fields are shown as separate slices on the chart. Increasing the grouping percent will group all slices below the threshold into a single Other category.

Labels

You can change the character limit and number of decimal places in the label. You can also choose whether the labels show the value of each slice (count or sum), the percentage, or both the value and percentage. The label settings apply to the legend, data labels, and hover pop-ups.

Slices

The categories displayed on the pie chart are listed under Slices. You can change the color or label for a slice by clicking the symbol color patch in the Slices list and choosing a new color or typing a new label.

Grouped slices

The categories displayed in the Other slice on the pie chart are listed under Grouped slices.

Format

The Format tab Format configurations are used to change the look of the chart by formatting text and symbol elements.

Chart formatting options include the following:

  • Text elements—Size, color, and style of the font used for the chart title, legend title, description text, legend text, and data labels. You can change the format for multiple elements at once by pressing Ctrl and clicking to select the elements.
  • Symbol elements—The background color of the chart.

General

The General tab General configurations are used to update the titles for the chart and legend.

The default titles for charts are based on the variable names and chart type. You can edit or turn off the titles on the General tab. You can also provide a title in the Legend title parameter. The Legend alignment can be set as Right, Left, Top, or Bottom. You can also add a chart description in the Description parameter. A description is a block of text that appears at the bottom of the chart window.

Resources

Use the following resources to learn more about charts: