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

Category Map: AllAreas and Nullcolor

Mon Dec 06, 2021 10:56 am

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: 308
Joined: Tue Aug 24, 2021 1:32 pm

Re: Category Map: AllAreas and Nullcolor

Tue Dec 07, 2021 3:15 pm

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
Highcharts support engineer

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

Re: Category Map: AllAreas and Nullcolor

Wed Dec 08, 2021 9:27 am

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: 308
Joined: Tue Aug 24, 2021 1:32 pm

Re: Category Map: AllAreas and Nullcolor

Thu Dec 09, 2021 10:55 am

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
Highcharts support engineer

Return to “Highcharts Maps”