mimamo001
Posts: 6
Joined: Fri May 12, 2023 2:33 am

How to Fix Typo in Map Chart

Hi All,

I saw this example of using map data from highcharts on Vietnam geography.

https://jsfiddle.net/gh/get/jquery/1.11 ... /vn/vn-all

I noticed that there were many typos. All the question mark should be "a" or "o" (e.g. L?ng S?n should be Lang Son).

How do I fix this issue?

Thanks,
jakub.s
Posts: 1229
Joined: Fri Dec 16, 2022 11:45 am

Re: How to Fix Typo in Map Chart

Hi,

Thanks for the question!

You're completely right.

Please feel free to report this as a bug on our GitHub repository: https://github.com/highcharts/highchart ... new/choose

Our Highcharts Maps Developers will take it from there.

When it comes to an easy workaround the easiest thing that comes to my mind is using dataLabels.formatter and checking for names with typos like this: https://jsfiddle.net/BlackLabel/L5uy6rcv/

You need to modify this function so that it detects a typo in a name (by looking for '?') and then correcting it to a proper name ('L?ng S?n -> Lang Son).

Unfortunately, I don't see any easier way to fix this as the entire TopoJSON file has '?' in names so it seems to be a problem with an entire map. If you manage to find other TopoJSON of Vietnam with all the proper names please try this out.

Do not hesitate to ask in case you have any more questions.

Kind regards!
Jakub
Highcharts Developer

Return to “Highcharts Usage”