keroro
Posts: 2
Joined: Mon Jul 03, 2023 9:32 am

about the zIndex of marker and map

Mon Jul 03, 2023 10:01 am

I want the seq is Marker>datalabel>map
I have read (viewtopic.php?t=46979) seem it is impossible for marker display in front of datalabel, is any new update now?

Or
can i set the zIndex of background map for lower?
expected result is Black circle on the front then the blue mapMarker then the map
myCode: https://jsfiddle.net/a8xn41b3/

jedrzej.r
Posts: 521
Joined: Tue Jan 24, 2023 11:21 am

Re: about the zIndex of marker and map

Mon Jul 03, 2023 12:45 pm

Hi!

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

Indeed, defaultly it's not possible to set marker in front of dataLabel in Highmaps. Fortunately, by overriding Highcharts plotGroup function, setting z-index of a dataLabel is made possible. Take a look at below example to see it in action.

Live demo: https://jsfiddle.net/BlackLabel/d3rz1vLu/

Reference: https://www.highcharts.com/docs/extendi ... highcharts

Let me know if that was what you were looking for.
Best regards!
Jędrzej Ruta
Highcharts Developer

keroro
Posts: 2
Joined: Mon Jul 03, 2023 9:32 am

Re: about the zIndex of marker and map

Tue Jul 04, 2023 4:15 am

thanks for your help! It bother me a lots. It is the thing I want and it work well.
but I dont reli understand your code for overriding Highcharts plotGroup function. What it is doing?

dawid.d
Posts: 707
Joined: Thu Oct 06, 2022 11:31 am

Re: about the zIndex of marker and map

Tue Jul 04, 2023 9:46 am

Hi,

The plotGroup method is a general abstraction for creating plot groups like series.group, series.dataLabelsGroup and series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size.

This method is wrapped, i.e. not exactly overwritten, but in this case, additional code is added before it is called. It sets the parent for dataLabelsGroup, which allows you to pull the pins to the top.

I hope it was helpful to you
Best regards

Return to “Highcharts Maps”