Search code examples
javascripthighchartsdom-events

Highmaps drill down map select event


I managed to create a map of Norway using 'Highmaps' (http://www.highcharts.com/maps/demo) with Counties and when it select a county it will drill down to the municipalities. I need to catch the select event in the drill down and display some data according to the municipality. But could not find any events for drilldown.

Any Ideas?


Solution

  • I figured it out with the help of Highcharts helpdesk support. Here is the fiddle http://jsfiddle.net/bydfsxe2/

    // Set drilldown pointers
    $.each(data, function (i) {
        this.drilldown = this.properties['hc-key'];
        this.value = i; // Non-random bogus data
    });
    
    // Instanciate the map
    Highcharts.mapChart('container', {
        chart: {
            events: {
                drilldown: function (e) {
    //call external function
                                        alert(e.point.drilldown);
    //rest of the code