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

point name in data not honored

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: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: point name in data not honored

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: 281
Joined: Wed Aug 10, 2011 8:22 am

Re: point name in data not honored

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: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: point name in data not honored

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: 281
Joined: Wed Aug 10, 2011 8:22 am

Re: point name in data not honored

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.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: point name in data not honored

Hello kzoon,

Thanks for the suggestion, we will take a closer look at it.

At the same time I highly encourage you to leave your feedback about this subject here:
https://highcharts.uservoice.com/forums ... script-api

And if you really looking forward to see such feature, then it would be great if you could create a future request on Highcharts github.

Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Maps”