Chapters

# Constructing a Pie Chart

In other sections, we showed you the basics of how to display data, also known as data visualizations. These included charts and plots such as bar graphs and histograms. In this section, we’ll go over what a pie chart is, how it’s constructed and in what scenarios it should be used.

## What is a Pie Chart?

Pie charts are a given in today’s data friendly environment - chances are, you’ve probably grown up seeing pie charts used in everything from the classroom to television. While it may seem super basic, pie charts are one of the most powerful tools you have to express important characteristics about your data. In 1858, **Florence Nightingale** produced her infamous “Diagram of the Causes of Mortality in the Army in the East,” known simply as her “Mortality Diagram.”

Looking at a picture of the diagram, you may notice that it looks a lot like a modified pie chart. Nightingale’s interest in both medicine and statistics allowed her to pioneer a new method of data visualization, one which many still consider to be one of the best innovations in the field. Emphasizing that the lack of proper hygiene and facilities was leading to more deaths during the Crimea war than the war itself, Nightingale used what is little more than a pie chart to **change public policy** for wars in the UK.

The reason behind the pie chart’s strength is its simplicity. Composed of a circle, each section, or “slice,” of the pie chart represents a certain **percentage** or proportion of the entire variable. You can use a pie chart to display categorical data and their frequencies. Let’s start with an example.

Number of Cavities | Frequency |

0 | 25 |

1 | 20 |

2 | 35 |

3 | 15 |

4 | 5 |

Looking at the table above, we can see that it represents a sample of 100 children from a school. The number of cavities indicates how many cavities were found in a child, while the frequencies represent how many children had a certain amount of cavities.

There are two main types of pie charts: a simple **pie chart** and a** pie of pie** chart. To build a simple pie chart, you must first find the relative frequency of each value. Discussed in further detail in other sections of our guide to descriptive statistics, relative frequencies are simply the percentage of a value over the total. Meaning, out of a 100 students, only 5 have 4 cavities, so the relative frequency of 4 cavities would be 5 out of 100. In the table below, we’ve calculated the relative frequencies.

Number of Cavities | Frequency | Frequency in Percentage |

0 |
| 25% |

1 |
| 20% |

2 |
| 35% |

3 |
| 15% |

4 |
| 5% |

As you can see in the table above, relative frequencies can be and typically are presented as percentages.

Most computer programs will automatically know how to display this information. While it’s unlikely you’ll ever have to draw a precise pie chart by hand, it can help your understanding of them by learning how they are built.

The most basic property of a circle is that it has **360 degrees**, where a degree is a unit to measure angles. Having only information about the percentages, we could probably approximate the table into a rough pie chart. However, the way programs do it is by calculating the number of degrees each percentage represents. To do this, you simply multiply the percentage with 360.

Number of Cavities | Frequency | Frequency in Percentage | Frequency in Degrees |

0 |
| 25% | |

1 |
| 20% | |

2 |
| 30% | |

3 |
| 15% | |

4 |
| 5% |

The frequency in degrees tell us specific information about the angle of each portion in the pie. Meaning, we now have instructions on **how wide** each slice of the pie should be. We can now draw our pie chart.

While the table tells us all the information we need to know, visualizing it in this way can be a more effective method of communicating the information. For those who don’t have background in relative frequencies or degrees, the pie chart tells them everything they need to know visually.

## Leave a Reply