I just want to know how to change the color of the county on Hover
That is the config of the mapOptions:
Code: Select all
const [mapOptions, setMapOptions] = useState
({
chart: {
backgroundColor: null,
map: [],
},
title: {
text: ''
},
credits: {
enabled: false
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
plotOptions: {
series: {
events: {
click: function () {
if (al === 1) {
console.log(this)
setAdm0(this.Code);
}
else if (al === 2) {
setAdmCode(this.Code)
console.log(this)
}
},
}
}
},
legend: {
enabled: false
},
xAxis: {
minRange: 0.1
},
yAxis: {
minRange: 0.1
},
series: [{
animation: false,
data: _adminCodes,
mapData: coordinatesFromApi,
joinBy: ['Code', 'Code'],
name: 'Random data',
allowPointSelect: true,
cursor: 'pointer',
nullColor: '#7CB5EC',
states: {
hover: {
color: "#AFE8FF",
borderColor: '#2A93FC',
},
select: {
color: '#AFE8FF'
}
},
dataLabels: {
enabled: true,
formatter: function () {
try {
return this.point.properties.Name;
}
catch (e) {
console.log(e);
//console.log(this);
}
}
}
}]
});
Many thanks
Fabrizio