DEV Community

Thales Bruno
Thales Bruno

Posted on • Edited on • Originally published at thalesbr.uno

3

Don't use Pie Charts

Despite the clickbait title, this is not an article to be polemic or say universal truths, but just an invitation to think about it.

A pie chart, sometimes called a pizza chart, is a chart in a format that seems like a - guess what? - pie, i.e., a round shape divided into slices. According to this article:

A pie chart is a circular graph that shows the relative contribution that different categories contribute to an overall total.

So, each piece of the chart has its width defined for its proportional value into an overall total.

Let's take a look at an example.

Simple pie chart

We see it's not a bad look chart for sure. Actually, it could be a pretty evident option if we have some category variable to analyze and plot. But the point many people say about avoiding them is because pie charts may don't do a good job showing the proportions of the parts vs. the whole or even if a piece is greater or less than the others if they have the same size, etc.

When the number of categories increases the problem seems clear:

Pie chart with many categories

A bar chart plotting the same data:

Bar plot

Then, as we see, pie charts are a bit controversial and should be avoided in most cases. Tough with a few categories, maybe only two or three, they may not be a terrible choice at all. What do you think?

References

Pie Charts in Python 🔎
University of Leicester | Pie charts 🔎
Why You Should Avoid Pie Charts 🔎

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay