How can I add custom data to my map series?
Currently, the custom data is an array-like object data: [string, number][] and its values look like: [["us",0],["uk",0],...].
Also it looks like the data is joinBy: ["hc-key", "hc-key"] but I cannot even access hc-key in the tooltip:
tooltip: {
headerFormat: '',
formatter: function () {
const country = this.point;
console.log(this);
// cannot access this['hc-key'] or country['hc-key']
const info = `The value for ${country.name} is ${country.value}`
return info;
}
},
// I also filter country by value like this:
colorAxis: {
dataClasses: [
{
from: 0,
to: 0,
color: "#9E9E9E",
name: 'No Data'
},
How can I make the series to take in a data structure like this instead of the array [[],[],...]:
[
{country: 'us', name: 'USA', some_value: 0, some_other_values: [{...},{...},...],...},
...
]
so I can display more information in the tooltip but still be able to style each country by its some_value?
I've looked at the answers like here and here but they don't work for me.
I'm working with the code from this example here.