lilbote
Posts: 4
Joined: Thu Aug 12, 2021 10:28 am

Add/Remove Countries on Europe Map

Hello,
How can I change this map in order to add another country (e.g Norway) and remove Great Britain, Malta and Cyprus ?
Also I don't understand why Belgium and Slovakia is not shown on the map even they have values.

https://jsfiddle.net/pf2n4o7v/

Thanks !
Marius
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Add/Remove Countries on Europe Map

Hello,

Welcome to our forum and thanks for contacting us with your question!

If you want to add Norway, you need to change the chart.map property to 'custom/europe' and import a proper europe map.
To remove some countries completely, e.g. Great Britain, Malta, Cyprus, etc., you need to copy the content of the imported map file, paste it to a separate script tag and remove the objects of those countries from the features array. For example, in the below demo I removed Great Britain - you can compare the original file to see a difference.

Another, much easier way to hide unwanted countries is to hide them in CSS by the "highcharts-null-point" class:

Code: Select all

.highcharts-null-point {
	display: none;
}

When it comes to hidden dataLabels - by default, when the labels don't have enough space, the value will not be shown. Of course, it will be displayed when zoomed in. To make them always visible you can set the allowOverlap: true property.

Demo: https://jsfiddle.net/BlackLabel/zgp50fc8
API Reference: https://api.highcharts.com/highmaps/ser ... lowOverlap

Let me know if that was what you were looking for!

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
lilbote
Posts: 4
Joined: Thu Aug 12, 2021 10:28 am

Re: Add/Remove Countries on Europe Map

Thank you Michal !
You answer is very helpful. I really appreciate your effort for providing this information.

KR,
Marius
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Add/Remove Countries on Europe Map

You're welcome!

In case of any further questions, feel free to contact us again.

Regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Maps”