How to create a pie chart
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 becomes hard to read – if you want to show more than five parts, consider grouping them or use a bar chart instead. Not sure if a pie chart is the right choice for your data? Read this article.
Below is an example of a pie chart that makes good use of the part of the whole concept: We can see that more than half of German land is used for agriculture:
- 1
-
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 "Housing & traffic", "Other land" etc.
- One column containing numeric values. The values in the second column will define the size of the pie slices.
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. In that case, it is better to opt for a bar chart instead of a pie chart.
Below is the data we used to create the chart at the top of the page:
Kind of land square km Housing & traffic 49254 Other land 11300 Agriculture 182637 Forest 106170 Water 8219 Source: Umweltbundesamt
-
Once you have prepared your data, create a new chart in Datawrapper. You can do so by going to our homepage and clicking on the "Start creating" button. In Step 1: Upload, copy & paste your dataset or upload it as a .csv or as a Google or Excel Spreadsheet. After pasting the data into Datawrapper, the text field on the right will look like this:
-
-
Click
"P
roceed" at the bottom right to go to the next step:
-
- 2
-
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 should automatically be converted to rows and columns, like the figure below. 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-aligned. To learn more about the Datawrapper's automatic recognition of data formats, visit this article.
Click on "Proceed" at the bottom left to go to Step 3: Visualize:
- 3
-
Visualize
Now comes the fun part because you can see a grid of different types of charts available under the tab ''Chart type''. Odds are that when you clicked on ''Visualize'' your data was automatically displayed as a line chart. To change that, click on the "Pie chart" symbol in the grid of available chart types:
-
-
Your data should now automatically be displayed as a pie chart but without a title, description or customized colors. The next step would be to further refine, annotate & define this chart.
We cover this in a separate tutorial which you can read here
.