Bar charts and pie charts are very common chart types with some overlap in use cases. In this article, youll learn more about when to choose each one.
What are bar charts and pie charts?
A detailed overview of each chart type is best left to dedicated articles, but a brief overview will be performed here.
A bar chart depicts numeric values against distinct categories in a two-axis plot. On one axis, the category levels are listed. For each category, one bar is plotted, and its length along the other axis corresponds with the numeric value associated with the category. The example bar plots below show how an apps user base is divided among different device types. Note that a bar chart can be oriented in two ways, with the bars oriented vertically or horizontally.
A pie chart shows how some total amount is divided among distinct categories as a circle (the namesake pie) divided into radial slices. Each category is associated with a single slice whose size corresponds with the categorys proportion of the total. The figure below plots the same data as above, but using the pie chart form instead.
When pie charts and bar charts can be used
While the example above demonstrates how the same data can be plotted in multiple ways, do not make the mistake of thinking that they are always interchangeable. With a bar chart, there is freedom on the numeric value axis to choose whatever values youd like. For numeric values that indicate metric totals or data point counts, the sums across groups will tend to be equal to the sum across the data as a whole. In cases like this, a pie chart is just as valid as a bar chart as a visualization choice.
However, if the numeric values indicate some other statistic where the sum across groups does not equal the statistic ignoring groups, thats when we run into problems. Examples include taking the average of a metric (e.g. average spend by user type) or if we look at proportions that are independent (e.g. proportion of survey respondents who use each of the polled apps). A bar chart is fine for this case, but a pie chart falls short. Since the circular shape implies that slices are parts of a whole, it is too easy for a reader to mistake a sum of slices as a representative of some sort of total.
Adding the average transaction sizes will not equal the average of the total.
In short, a pie chart can only be used if the sum of the individual parts add up to a meaningful whole, and is built for visualizing how each part contributes to that whole. Meanwhile, a bar chart can be used for a broader range of data types, not just for breaking down a whole into components.
Shortcomings of the pie chart
Even with data where a pie chart could be used, the pie chart may not be a good choice of visualization. There are many cases that can cause problems for a pie chart.
- Interested in exact contribution from each group: Ignoring the presence of additional annotations, it can be difficult to tell what proportion of the whole each slice occupies. While it might be easy to make a judgement when a slice takes up a multiple of 1/3 or 1/4, its much harder to pin down a smaller value or one in between. This is fine if we want to be able to take away judgments like more than half or about a third, but for finer-tuned messages, the visualization doesnt stand on its own.
- Multiple slices have similar values: Since pie charts usually dont have markings around their circumference, it can be hard to compare the groups of similar size. While its a good convention to sort the slices, this is not a guaranteed step in pie chart creation. Without annotations, at best we can say that the two groups are similarly-sized but not which one is larger.
- Too many slices: If there are too many slices, then itll probably run into the problem of either there being similarly-sized slices (see the above) or slices that are too small. Those small slices can be difficult to read and color distinctly.
The above limitations can be alleviated with the use of a bar chart. It is much easier to gauge exact values from bar lengths rather than slice areas or angles, especially since the bar chart naturally has one axis dedicated to value markings no annotations necessary. If the proportions are needed, then axis values can be in terms of proportion rather than the natural units. It is also easier to detect small differences from bar heights, even if they are placed out of order. When there are lots of categories, its relatively easy to find additional space for more bars, especially if they are plotted horizontally.
Overall, the bar chart is a much more information-dense visualization than the pie chart. In fact, your default choice should probably be a bar chart. If youre not certain whether a pie chart will be a good choice of visualization, then its best to play it safe with a bar chart.
When a pie chart should be used
That isnt to say that a pie chart has no place in visualization: it can be effective when conveying findings to others. The one major benefit to the pie chart is that it immediately sells the idea of a part-to-whole comparison. With a bar chart, it may not be immediately clear how much each bar contributes to the whole, or that its the kind of comparison that is of interest, unless the bar units are in terms of proportions or percentages. In that latter case, additional annotations are needed anyways to note both an absolute value as well as the relative value.
On the other hand, a pie chart is familiar and suits our aesthetic sensibilities. Especially if we care only about one or two slices, a pie chart can help highlight the story around those parts. When slices are around the small fractions (1/3, 1/4), those takeaways can be easily conveyed by a pie. Combining uninteresting or small slices into an other group can clean up the information that a pie chart needs to display. A bar chart might be better in the general case, but if you need to present findings to others, a pie chart might end up being more effective and appealing.
Both the bar chart and pie chart are common choices when it comes to plotting numeric values against categorical labels. Generally, the bar charts versatility and higher information density makes it a good default choice. However, pie charts have a tight niche if it is to be the right choice for conveying information:
- Individual groups values must sum up to a meaningful total
- A part-to-whole comparison must be of interest, rather than a group-to-group comparison
- The number of slices should be relatively small, about five at most
- Slices of interest should carve out identifiable proportions of regions, multiples of 1/4 or 1/3
Without these bullet points in place, a bar chart is probably the better choice. But if theres a question about which one to use, its always worth playing around with both to see which chart type presents your data the best.