Double Click

author(s): Torstein Hønsi

by amrutaJgtp

HTML

<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/europe.js"></script>


<div id="container" style="height: 500px; min-width: 310px; max-width: 600px; margin: 0 auto"></div>

JavaScript

$(function() {
  // Instanciate the map
  $('#container').highcharts('Map', {
    chart: {
      borderWidth: 1
    },

    title: {
      text: 'Nordic countries'
    },
    subtitle: {
      text: 'Demo of drawing all areas in the map, only highlighting partial data'
    },

    legend: {
      enabled: false
    },
    
    mapNavigation:{
    		enabled:true,
        enableDoubleClickZoomTo:true
    },
    
    plotOptions: {
      series: {
        mapData: Highcharts.maps['custom/europe']
      }
    },
    series: [{
      name: 'Country',

      data: [{
        code: 'IS',
        value: 1
      }, {
        code: 'NO',
        value: 1
      }, {
        code: 'SE',
        value: 1
      }, {
        code: 'FI',
        value: 1
      }, {
        code: 'DK',
        value: 1
      }],
      joinBy: ['iso-a2', 'code'],
      dataLabels: {
        enabled: true,
        color: '#FFFFFF',
        formatter: function() {
          if (this.point.value) {
            return this.point.name;
          }
        }
      },
      tooltip: {
        headerFormat: '',
        pointFormat: '{point.name}'
      }
    }]
  });
});