Change map colour for highmap - Javascript highmap

Javascript examples for highmap:Map

Description

Change map colour for highmap

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {//from   w  ww .ja  v a 2 s . c o  m
    $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function (data) {
        var mapData = Highcharts.geojson(Highcharts.maps['custom/world']);
        // Correct UK to GB in data
        $.each(data, function () {
            if (this.code === 'UK') {
                this.code = 'GB';
            }
        });
        $('#container').highcharts('Map', {
            chart : {
                borderWidth : 1
            },
            title: {
                text: 'World population 2010 by country'
            },
            subtitle : {
                text : 'Demo of Highcharts map with bubbles'
            },
            legend: {
                enabled: false
            },
            mapNavigation: {
                enabled: true,
                buttonOptions: {
                    verticalAlign: 'bottom'
                }
            },
            series : [{
                name: 'Countries',
                mapData: mapData,
                nullColor: 'red',
                enableMouseTracking: false
            }, {
                type: 'mapbubble',
                mapData: mapData,
                name: 'Population 2010',
                joinBy: ['iso-a2', 'code'],
                data: data,
                minSize: 4,
                maxSize: '12%',
                tooltip: {
                    pointFormat: '{point.code}: {point.z} thousands'
                }
            }]
        });
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/maps/highmaps.js"></script> 
      <script src="https://code.highcharts.com/maps/modules/data.js"></script> 
      <script src="https://code.highcharts.com/mapdata/custom/world.js"></script> 
      <div id="container" style="height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials