littlerave
Posts: 37
Joined: Sun May 16, 2021 4:17 pm

Set cursor to pointer only when a country has data

Hi,

I'm trying to set the cursor to a pointer but only for countries, that have actual data, which I seem to be unable to. I assume, because of the custom mapData I'm using, highcharts is unable to differentiate between series.data and series.mapData. I feel like I have to set cursor or style on one of them but neither offer any of the two options. I can only set the cursor for the whole series, which then sets it for every country, regardless of whether it has data or not.

I've also tried to set cursor and/or style to plotOptions.map and plotOptions.series but again, cursors get set for every country. I've also tried a combination of both but that didn't work either. Please see the sample: https://stackblitz.com/edit/angular-ivy ... mponent.ts

Best regards
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Set cursor to pointer only when a country has data

Hello littlerave!

We appreciate you reaching out to us!

I found a very similar topic that has a solution to your problem: viewtopic.php?t=12758

In short, we can go through all of the data and update the point's graphic attribute to the pointer when its value is bigger than 0.

Demo: https://stackblitz.com/edit/angular-ivy ... mponent.ts

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Maps”