How to create a pie chart
This Academy article is outdated. It explains how to create the pie charts that we archived on December 14, 2018. We replaced them with shiny new pie charts! We will update this Academy article accordingly in January 2019.
A pie chart is useful when you want to show proportional parts of a whole. A pie chart should not have too many slices, as the chart otherwise gets cluttered and hard to read – if you want to show more than five parts, consider grouping them or use a bar chart instead. If you want to understand if a pie chart is a right choice for your data, visit this article.
Below is an example of a pie chart that makes good use of the part of the whole concept: The user can see that the number of people voting to leave the EU in the "Brexit" was only slightly higher than the group which voted for "remain":
Preparing and importing the data
If you want to create this chart type, your data needs to be in a certain format. You'll need:
- One header row containing descriptive labels.
- One column containing at least two categories. This will determine the label in the pie slices. In our case, that's "Remain" and "Leave".
- One column containing numeric values. The values in the second column will define the size of the pie slices.
The two bars will later be distinguished by colors.
The most important thing you have to keep in mind is that a pie chart always represents a whole, i.e. 100%. Therefore, you can only use data that is based on exclusive values. Making a pie chart of a survey that allows multiple answers will lead to a misleading chart. Use a bar chart instead, but never a pie chart.
That's the data we used to create the chart at the top of the page:
EU Referendum Votes Remain 48.1 Leave 51.9
Source: The Electoral Commission
Once you prepared your data, create a new chart in Datawrapper. You can do so by going to our homepage and clicking on "Create a chart". In Step 1: Upload, copy & paste your dataset, upload it as a .csv or an Excel sheet. After pasting the data above into Datawrapper, it will look like this:
roceed" at the bottom right to go to the next step:
Check & Describe
In the second step, you can check if your dataset was imported correctly and make changes to it - if necessary. If you did not upload a header row, you have to untick "First row as label" to avoid losing your first row of data. Always remember to do this if you don't have descriptive row and column headers.
In step 2, your data looks like this. You can see that Datawrapper correctly recognized your numbers as numbers (and not as text or dates) because they are colored in blue and are right-alined. To learn more about the Datawrapper's automatic recognition of data formats, visit this article.
To add percentage signs to the numbers, click on the header column ("B") and add a percentage sign into the appearing "append" field.
Click on "Proceed" at the bottom left to go to Step 3: Visualize:
In this step, you see a first chart. It's probably a line chart. We want to change that. To do so, click on the "Pie chart" symbol in the grid of available chart types:
You will now see a pie chart, without a title, descriptions or customized colors. Maybe you want to further refine, annotate & define this chart.
We cover this in a separate short tutorial found here