As well as in the previous example, the easiest way to bring your data into our charts is using Gapminder offline app. You can also use your data with bare vizabi running in a web browser, but to do that it’s also better to start by importing the data into Gapminder offline and then do “export to web” so you will have a generated code example you can directly open in web browser. By modifying that example later you can gain more flexibility
- Download Gapminder Offline if you still haven’t
- Change column headers to the ones requested by the application. Can be “geo” and “time”
- Change your country names to the ones we use in Gapminder
- Here is the table that defines the mapping
- Make sure you use years as time points and they look like 1995, 2016, etc
Suppose you have a chart like this to start from:
And you have a data like this:
When you are adding data to the current chart, you will get a message that the entities should match. We use our own country codes in Gapminder (swe for Sweden, cyp for Cyprus etc). So if you want to match up your data with our country codes you also need to use them.
Use VLOOKUP Excel function to search the dictionary and replace the country names with Gapminder country codes.
Make an extra sheet and insert the mapping table in there. Actually you need just two columns from the mapping table: country names and country codes, let names be the first column, because VLOOKUP uses the first column to find the matches.
Return to the sheet with data
Add a column between country names and the indicators
Add a formula in the second column:
- here A1 is the country name to look up
- ‘COUNTRY MAPPING’ is the name of sheet where to look it up
- A:B is the range of columns where to search for the name A1
- 2 is the index of the column which contains the value to be returned
- FALSE means that the match should be strict, this is important!
once done with the formula, pull it so that it stretches for all the rows The resulting table looks like this:
There will be a few unresolved matches, displayed as #N/A. You will have to resolve those manually, or remove the rows. Once ready, delete the country name column and you should have something like this:
Observe that the column 1 should be named “geo”, like it was suggested by Gapminder offline app.
Export a CSV and give it to Gapminder offline app.
Select an appropriate data arrangement. In our example it’s time in columns.
The chart reloads, and the additional information appears in the menu. You can select one of the indicators now and you will see the picture: