Search code examples
highcharts

How to make country click work in "HighchartMap" (clicking on markers on the map works)?


When click on a country's territory, the handler is not called, the function is not executed. The problem is shown in the examples below:

  1. my examle jsfiddle
  1. my examle codesandbox + vue

Solution

  • The click event won't work if the series.enableMouseTracking property is disabled. By default it is enabled, so in this case I'd recommend removing this line.

    series: [{
        data: dataCountry,
        joinBy: "name",
        enableMouseTracking: false, // delete this line or set to true
        point: {
            events: {
                click() {
                    alert('click country');
                }
            }
        }
    }]
    

    Demo: https://jsfiddle.net/BlackLabel/f2wau5mt/