I am trying to achieve something like in this example: JSFiddle chart example. However, I am using a map NOT a line chart. I did the work around, and it is working with the below issues that I need solution for :
- When I click on a country, the tooltip gets displayed, BUT once I move the pointer away the content or the text disappears. However, the tooltip's outline remains static. You can see here, the texts moves away with the cursor moving out (which is the tooltip's basic functionality).
- Secondly, I have an action to trigger that will take the value and the name of the country, for updating other chart component. Once the action is dispatched and the store updates, the tooltip that is supposed to remain over the country it was clicked, disappears. You can find the config's plotOptions below: where I am triggering action at the end of the click event
this.config.plotOptions = {
map: {
allAreas: false,
nullColor: "#d6d6d6",
},
series: {
cursor: "pointer",
stickyTracking: false,
marker: {
enabled: false,
states: {
hover: {
enabled: false,
},
},
},
events: {
click: function() {
this.selectedCountry = this.chart.hoverPoint.name;
this.selectedValue = this.chart.hoverPoint.value;
console.log(this.chart);
var x = a.checkCountry.length;
if (x > 0) {
a.clone[0].remove();
a.clone.splice(0, 1);
a.checkCountry.splice(0, 1);
}
var cloneToolTip = this.chart.tooltip.label.element.cloneNode(true);
this.chart.container.firstChild.appendChild(cloneToolTip);
a.checkCountry.push(this.selectedCountry);
a.clone.push(cloneToolTip);
/*Action goes here*/
},
},
},
};
I tried the net and highcharts Q&A, but didn't find an appropriate solution.
Finally, again what I want to achieve is
A tooltip that is displayed on click over a country on highcharts map, and does not disappear until another country is clicked. Plus, I want to trigger an action on selecting a country, don't know if I am triggering from the right place currently.
Your help is appreciated!