Zoom to area by double click
(async () => { const topology = await fetch( 'https://code.highcharts.com/mapdata/custom/world.topo.json' ).then(response => response.json()); Highcharts.getJSON('https://highcharts.com.cn/demo/maps/world-population-density.json', function (data) { // Prevent logarithmic errors in color calulcation data.forEach(function (p) { p.value = (p.value < 1 ? 1 : p.value); }); // Initialize the chart Highcharts.mapChart('container', { chart: { map: topology }, title: { text: 'Zoom in on country by double click', align: 'left' }, mapNavigation: { enabled: true, enableDoubleClickZoomTo: true, buttonOptions: { verticalAlign: 'bottom' } }, mapView: { fitToGeometry: { type: 'MultiPoint', coordinates: [ // Alaska west [-164, 54], // Greenland north [-35, 84], // New Zealand east [179, -38], // Chile south [-68, -55] ] } }, colorAxis: { min: 1, max: 1000, type: 'logarithmic' }, series: [{ data: data, joinBy: ['iso-a3', 'code3'], name: 'Population density', tooltip: { valueSuffix: '/km²' } }] }); }); })();
MapsDynamic
Install with NPM
The official Highcharts NPM package comes with support for CommonJS and contains Highcharts, and its Stock, Maps and Gantt packages.
npm install highcharts --save
See more installation optionsDownload our library
The zip archive contains Javascript files and examples. Unzip the zip package and open index.html in your browser to see the examples.
DownloadBuy a license
You can download and try out all Highcharts products for free. Once your project/product is ready for launch, purchase a commercial license.
See License Pricing