Maxime74
Posts: 73
Joined: Wed Sep 17, 2014 8:34 am

Bring hover borders to top on treemaps

Hello,

On treemaps, the hovers borders are often displayed under the borders' strokes of the adjacent areas :
https://jsfiddle.net/raxvgfc3/

On this exemple, I've set the hover style to have a blue border. But as you can see, only the bottom right rectangle "Susanne" have all its blue borders displayed when hovering it with the mouse.
I'm looking for a way to have the blue stroke all over displayed elements.

Thank you for your help.
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Bring hover borders to top on treemaps

HI! Thanks for contacting us with your question!
As you can see, the border is displayed on every side of the tile. What you can do, is to call toFront() method so that the border isn't overlapped by anything. Check this demo: https://jsfiddle.net/BlackLabel/dxeo9kp6/1/
Let me know, if that works for you!
Kind regards,
Paweł Lysy
Highcharts Developer
Maxime74
Posts: 73
Joined: Wed Sep 17, 2014 8:34 am

Re: Bring hover borders to top on treemaps

Hi Pawelys,

That's almost the behavior I was expecting.
But in my case, the lvl1 group is delimited by a wider border width, and it's hidden by the effect applied by the mouseOver function.

https://jsfiddle.net/aob709gq/

Any fix ?
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Bring hover borders to top on treemaps

Hi,
Thanks for the message and your question.

When I set the border color for the whole series they look good, please take a look and let me know what you think.

Code: Select all

  plotOptions: {
    treemap: {
      borderColor: 'black'
    }
  },

Demo:
https://jsfiddle.net/BlackLabel/xdhvjzem/


Best regards.
Sebastian Hajdus
Highcharts Developer
Maxime74
Posts: 73
Joined: Wed Sep 17, 2014 8:34 am

Re: Bring hover borders to top on treemaps

Hi,

Here is some screenshots to illustrate what I mean.
More over, the borders still hidden when the mouse goes out of the plot area.

Image
Image

Regards.
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Bring hover borders to top on treemaps

Hi,
Thanks for the screenshots.

I managed to get something else like this by changing the settings of the second level.
https://jsfiddle.net/BlackLabel/Lvzj38af/

Regards.
Sebastian Hajdus
Highcharts Developer
Maxime74
Posts: 73
Joined: Wed Sep 17, 2014 8:34 am

Re: Bring hover borders to top on treemaps

Thanks Sebastian,

That's what I'm looking for.
I'll try to make it work in real condition and give you a feedback.

Regards.
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Bring hover borders to top on treemaps

Hi,
You're welcome.

Sure, let me know if you will have more questions.
Regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Usage”