KamilAtWork
Posts: 2
Joined: Mon Dec 06, 2021 10:28 am

Category Map: AllAreas and Nullcolor

I took the Category Map Example and removed one country from the sample (Island).
When allAreas = False, Island just dissapears. Instead I've set allAreas = True and nullColor = 'none'.
https://jsfiddle.net/fjsv8kr0/

There are two problems now:
First (more severe): I dont want null-Countries to have the same color as the sea. Setting nullColor to something else breaks everything else.

Second: Because the series is split, every country gets rendered multiple times (4 times in this example) which just adds unneccessary rendering and lower performance.
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Category Map: AllAreas and Nullcolor

Hello KamilAtWork,

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

To set nullColor to a different colour, you need to:

- add nullColor = 'none' property to every series and nullColor = 'color' to series you wanted to change
Demo:
https://jsfiddle.net/BlackLabel/7Lwjhdbf/

- or create fake series for null areas.
Demo:
https://jsfiddle.net/BlackLabel/sq9pn20g/

Multiple rendering will be discussed in our dev team. You can track this topic here: https://github.com/highcharts/highcharts/issues/15796

Let me know if you have any further questions,
Regards!
Magdalena Gut
Developer and Highcharts Support Engineer
KamilAtWork
Posts: 2
Joined: Mon Dec 06, 2021 10:28 am

Re: Category Map: AllAreas and Nullcolor

Hello Magdalena,

Thanks that helped me alot. I like the first approach more and want to add that it's enough to add the nullColor property to only the first series and set the plotOptions->map->nullColor to 'none'.
https://jsfiddle.net/xamc36fp/

The second approach does add the Fake Series to the legend.

I'm looking forward to a fix for the multiple rendering issue.

Kind regards!
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Category Map: AllAreas and Nullcolor

You're welcome!

That's true, setting nullColor = 'none' at plotOptions is better solution, thank you for noticed that and sharing!

Feel free to ask any further questions,
Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Maps”