How to create your first choropleth map
This is a very detailed tutorial on how to create and play around with your very first choropleth map in Datawrapper.
In this academy article, you will learn how to build a choropleth map to show unemployment data by the International Monetary Fund (IMF) in European countries. This is what it will look like:
Through the process, you'll learn about:
- choropleth map settings
- how to best use colors for highlighting differences
You'll also touch on:
- how to navigate the IMF Data Portal
- How maps are great for showing patterns
- how to show multiple values in tooltips
- how to write a chart title
- how to share & embed settings after publishing
How to get the data
In this section, you'll learn how to get the data from the IMF Data Portal. If you want to skip this part and go straight to learning how to create a map, we've also prepared a Google Sheet with the data for you. In this case, go to this Google Sheet, copy the data, and head on over to the next section "How to create a choropleth map".
First, you have to prepare the data. Go to the World Economic Outlook Database in the IMF database. You'll find a box that says "Download WEO Data: October 2019 Edition". Click on the link that says "By Countries (country-level data":
You want to create a map of European countries, but this IMF database doesn’t have a selection of European countries, just of the “Euro area” and “Emerging and developing Europe”. To get all European countries, the easiest way in this IMF source is to select “All countries”:
You can import the data for all countries to Datawrapper, but countries that don’t belong to Europe won’t be visible in the final map. That’s because we’ll choose a map that just displays the European countries and gets rid of the data points of countries that don’t belong to Europe.
Here you see the countries you've chosen. Click on “ Continue”:
You will get a long list of possible variables you can choose from. Scroll down until you find the “ Unemployment rate”, then click on the checkbox. Finally, scroll up again to click “Continue”:
Now, you can select the Date Range.
- set the start and end year as desired (e.g. 2000 to 2017). You’ll see in the final table that values for the present year and the future is estimated.
- uncheck “Append Country/Series-specific Notes”
- check “ISO Alpha-3 Code”
- uncheck “Subject Descriptor”
Click “ Prepare Report” to finally get to your data.
It should load immediately:
Hurray, here’s your data!
Select the data from the header to the end.
Make sure that you selected all the text and numbers inside the table, but nothing outside of the table.
Now copy the data, either with clicking Cmd+C (or Ctrl + C), or with right-click > “Copy”:
How to create a choropleth map
Now that we got our data, let’s create a map! You will create a choropleth map with this data. Each country will be filled with one color that will encode one underlying value, for example, the latest unemployment rate in this country.
Select a map type
So go to app.datawrapper.de/create/map (or to app.datawrapper.de >> “Create new” >> “Map” at the top), and click on “Choropleth map.”:
Choose a base map
First, Datawrapper asks you which administrative boundaries you want to show your data in. You can choose from all the countries around the world but let's focus on countries in Europe for now. Search for “Europe” in the list of available maps. When you select Europe, you’ll see the outlines of European countries on the right:
Once you see the Europe map on the right, click on the “ Proceed” button:
Upload your data
In the second step, Datawrapper asks you to upload your data.
Here you could type in the values for each European country which would show up in the map immediately. But that’s a lot of work!
That’s why we scroll down to the "Copy & paste" textfield, where we can simply paste the data. You can upload as many columns as you want for your map.
To get your data from the Copy & paste textfield into the table, click on the blue arrow button next to it.
Match your data with the base map
The next step is to match your data with the map. Click on the Match tab and select the correct columns to match the key and the value:
Now, you should now see the IMF unemployment data in the table to the right, and the Europe map filled out. At this point, you may notice that some cells are highlighted in red:
A red cell indicates missing data or a problem in your dataset. To check what's going on, we can go to the “ Check” tab below the map:
Check & correct your data
Here, Datawrapper lists all the ISO codes that are not available in the map. That makes sense: We have data for the whole world, but only want to show a map of Europe.
But if we scroll all the way to the bottom of the Check tab, Datawrapper tells us something else: That there are three countries on the map that are not filled with any data. Interesting! We can find them at the end of the table.
Apparently, Datawrapper couldn’t match any data for Andorra, Kosovo, Liechtenstein and Monaco. It makes sense to check if Andorra, Kosovo, Liechtenstein and Monaco are really not in the dataset, or if the ISO code is simply different/wrong. And indeed – if we search for the three countries in the upper right, we can find data for Kosovo, but with another ISO code:
To give Kosovo the right ISO code, we can click on the little arrow next to the wrong one and choose “KOS” from the drop-down menu. The map will update automatically.
Looks like our map is filled with data!
Visualize your data - colors, tooltips, annotations and more
Click on Step 3: Visualize (or scroll all the way down to click on “Proceed”) to actually design your map. To make sure it shows the unemployment rate of the right year, click on “Select column”, then the column you want to show: You can then choose if you want to show your colors on a continuous spectrum or as steps:
Further, you can customize the steps themselves or, when coloring on a continuous spectrum, select the interpolation:
Experiment with the color gradient. You will notice that the visual difference between the countries is very high when you choose “quintiles” or “deciles”, and not so high when you choose “continuous”.
Play around with the color palette tool, maybe choose another column and other steps or interpolation, until you’re happy with your result.
You can explore the rest of the options on this page. For example, try adding a pattern overlay for more context, or turning off the map zooming-in option, changing the map key and adding a map key title. If you want to add line breaks in the map key title, use the HTML tag <br>.
If you’re done, go to the tab “ Annotate” and give your map a proper title. Note that it is a good idea to choose a title that explains in words what your readers can see visually in the chart.
Don’t forget the source and the byline, so that everyone knows which great data designer has designed this map!
To help readers make sense of the underlying numbers, you should implement tooltips.
They will show up when the readers hover their cursor over one of the countries, or when they click on it on their mobile phones and tablets.
To create tooltips, let’s click on “ Customize tooltips”:
Two textfields will appear in which you can define the title and content of your tooltip.
Underneath, you can see all the columns you uploaded.
You can click on the names of the columns to insert them directly in the title or body. If you do, you’ll see curly brackets around the name of the column. This will tell Datawrapper to show the actual name of a country (e.g. “Germany” or “France”) when you hover over it, and not the word “Country”:
If you want to Datawrapper to add specific formatting, you can click on the downwards arrow next to a variable and select your desired formatting from the dropdown:
You can also add text and links to the tooltips, as well as HTML tags. So you can make text bold when you write the HTML tags <b></b> around them, create HTML tables within the tooltips, and even insert if-else statements. To read more, visit another Academy article "How to customize tooltips". Now you have working tooltips! Try to hover over countries. This is what they should look like.
Publish your map
Once you’re happy with how your map looks like, you can go to Step 4: “Publish & Embed” with a click on the last arrow.
There, click on “Publish chart”.
It will take a second or two, and then you see some “Share & Embed” options.
You can copy the embed code to use the map in an article of yours, or you can share the URL on social media or in emails:
Try clicking on the sharing URL to see what it looks like. If you hover over the data, you will notice that the chart is interactive and has the tooltips you've designed!
And that’s it! Congratulations on creating your first Datawrapper choropleth map, and thank you so much for following this tutorial.
Do you have questions about options in a specific chart type? Click on the categories to the left of this Academy article to find out more about pie charts, bar charts, dot plots, etc.
To find out more about Datawrapper in general, go to our website. And if you have any questions, we're always happy to help at support@datawrapper.de.