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 datawrapper.de >> “Start Creating” >> “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 “ Next” 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 “Upload data” 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 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 Kosovo, Liechtenstein and Monaco. It makes sense to check if 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 year you want to show:
To make sure your map shows different colors for different values, click on “ Stops” and then on “min/max” or on “quartiles”.
Experiment with the Stops. 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 “min/max”.
You can also choose another color gradient on the left. Play around with the color palette tool, maybe choose another column and other Stops, until you’re happy with your result.
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”:
Again, a popup window will open, in which you can define the title and content of your tooltip.
On the top right, 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”:
You can also add text and links to the tooltips.
And HTML tags are allowed, so you can make text strong when you write the HTML tags <strong></strong> or <b></b> around them, and even create HTML tables within the tooltips. To read more, visit another academy article "How to create tooltips".
When you’re done, you can click “ Save” at the bottom of the tooltip editor:
Now you have working tooltips! Try to hover over countries. This is what they should look like.
You can explore the rest of the options on this page. For example, try turning off the map zooming-in option, or change the map key and add 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!
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 URL to see what it looks like:
Try to hover over the data, and you will notice that the chart is interactive and has 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.