A common task in data visualization is to compare the sizes of categories. For example, in our vehicle data we might want to compare how many cars are being produced as opposed to SUVs or trucks. Column charts and pie charts are simple ways to visualize categorical data and make comparisons.
For this exercise, we’ll look at a dataset containing data on the production shares (%) for different types of vehicles in 2020 (from the Bureau of Transportation Statistics).
In column charts, each category is represented by a column in the plot and we can compare them by assessing the length of the columns or bars. Note that these are commonly also called bar charts, but the tool in Excel calls them column charts.
In pie charts, each category is viewed as a “slice” or
sector of a pie, with the size (or area) of the slice corresponding to the relative size of that category. Because the categories as slices make up the whole pie, pie charts should only be used to visualize categories that are pieces of some whole. In other words, the area of the sectors (slices) should add up to 100%.
In our dataset, the different vehicle categories are all part of the same whole: the collection of all vehicles in 2020.
Let’s look at a related dataset that might not be very suitable for pie charts. This table shows the production share of cars from 2015 to 2020:
While we can certainly plot a pie chart, it would be misleading, because these percents are not pieces of the same whole. They are each “slices” of their own year, and shouldn’t be placed together in a pie. Make sure to evaluate your data to see if a pie chart is a right choice for visualization!
We’ve placed a slideshow illustrating how to create both types of charts in the learning environment. When you’re ready to practice this yourself, move on to the next set of instructions!
When you’re ready to practice what you’ve learned, download and work through our exercise spreadsheet. A couple of important points to keep in mind:
- Unlike formulas and pivot tables, we can’t automatically assess your visualizations. We have placed solutions to each exercise within the same spreadsheet. Feel free to compare your work to ours if you get stuck or to check if your solution is correct. Your visualization may not look identical to ours and that’s okay!
- There are lots of options we haven’t covered — feel free to play around and see how different options work!
- You can always re-download the spreadsheet if you want to start fresh.
Once you’ve finished, think about the next question.
Question: The column chart and pie chart you’ve created reflect the same data. What is the advantage of using each type of visualization?