Add country names to your maps

Charts

If you’re looking to view full country names in your Map charts when you hover over a country, you will need to standardize the naming in your country column to only use full country names. If your column includes different naming conventions (ie a mix of abbreviations and full names), we won’t be able to recognize which one to use.

Add country names to your maps

If this country naming convention isn’t possible to uphold on your database directly, two options are possible in Chartio:

1. If you’d like this option in numerous charts, you can create a custom column with a case statement changing all the country codes or abbreviations to full country names. You would then use this custom column in your Interactive Mode queries where you’re looking to create Map charts.

2. Edit your country column in the Data Pipeline by using the Edit Column Pipeline Step. You’ll then want to select Custom from the Formula Type dropdown and create a case statement to change the country codes to full country names using SQLite syntax as shown in the example below.

The country column in our example Map is named ‘Country’ but simply replace this with your column’s name in the example below.

CASE WHEN "Country" = 'AU' THEN 'Australia'
WHEN "Country" = 'CA' THEN 'Canada'
WHEN "Country" = 'US' THEN 'United States'
ELSE "Country"
END

Note: This case statement will need to include all countries within your column for the country name labels to be applied to your chart. If some country names include abbreviations or typos, they will not be recognized on your map.

Once your case statement is completed, make sure to update your chart settings to recognize your new column format. To do this, open your chart’s Settings and under the General tab, select “Name” from the Area code/name dropdown. Click Done once completed.

Update Chart Settings

Your final chart will now show both the name of the country you’re hovering over as well as the measure values.

Final result


Related Charts Help Articles

See more