kzoon
Posts: 280
Joined: Wed Aug 10, 2011 8:22 am

point name in data not honored

Fri Apr 02, 2021 3:10 pm

I provide a name for my points in the data. I expected to see that name in data labels and tooltips, like API documentation states:
The name of the point as shown in the legend, tooltip, dataLabel etc.
But the name from points is ignored.
See https://jsfiddle.net/kzoon/zbe3qrvj

Only when I use 'myName' as key and change the format for data labels, does it show:
https://jsfiddle.net/kzoon/zbe3qrvj/2

But that is not what the documentation says. And its inconvenient, because point.name is used elsewhere (in the tooltip for instance)

Is this a bug, or am I doing something wrong here?

dominik.c
Posts: 1372
Joined: Fri Aug 07, 2020 7:07 am

Re: point name in data not honored

Tue Apr 06, 2021 7:55 am

Hello kzoon!

We appreciate you reaching out to us!

When you create your own attribute to a point like myName it gets saved and you can display it as dataLabel but when you want to overwrite the name attribute it doesn't work because you're using code attribute which determines the name of the point.

When you create a point with your own path then the name property works fine. Check it out: https://jsfiddle.net/BlackLabel/bhdn7vk5/

Best regards!
Dominik Chudy
Highcharts Developer

kzoon
Posts: 280
Joined: Wed Aug 10, 2011 8:22 am

Re: point name in data not honored

Wed Apr 07, 2021 12:30 pm

Code is used to map to the right country.
I would expect name (when provided) to override the display name of the country.
This way I can determine the displayed name (for instance choose my own language) without having to modify the actual map.

The API https://api.highcharts.com/highmaps/ser ... .data.name doesn't make the limitation that name is only applied when you supply the path in data.

dominik.c
Posts: 1372
Joined: Fri Aug 07, 2020 7:07 am

Re: point name in data not honored

Thu Apr 08, 2021 12:22 pm

Hi again!

You're right, it's not clear. We'll consider changing this explanation.

Thanks for pointing this out.

Best regards!
Dominik Chudy
Highcharts Developer

kzoon
Posts: 280
Joined: Wed Aug 10, 2011 8:22 am

Re: point name in data not honored

Fri Apr 09, 2021 12:09 pm

I would change the code, not the documentation.

It is fairly common to use different area names for the same map.
Think about language support. The Netherlands in different languages:
Dutch: Nederland
German: Die Niederlande
French: Pays-Bas

You don't want to us a different map for each user language. You want to push in the right name for the country through the data.

Return to “Highcharts Maps”