Frank Lou
Posts: 4
Joined: Mon Oct 15, 2018 9:38 am

How to get the country code according to country name?

Hi everyone:

I want to create a world map,and the data from backend just like this:

Code: Select all

[{
name: "AUSTRALIA"
value: 5641.03584
z: -0.20746483685821882
},{
name: "CANADA"
value: 39172.911496
z: -0.10119352578179375
}]
I use the value to draw world map, and z to draw bubble, but I don't know how to get the country code(code3) according to the country name so I can use

Code: Select all

joinBy: ['iso-a3', 'code3']
to show bubble on the map. Is there any object to map the name to code3, or I only can get this from backend?

Best regards,
Frank Lou
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: How to get the country code according to country name?

Hi, Frank!

I think you will need to put the right properties to your data in backend. Then join them by the same property name. I would show you an example and specify my answer if I could see a demo of your chart (series).

Best regards!
Rafal Sebestjanski,
Highcharts Team Lead

Return to “Highcharts Maps”