GeoJSON areas

author(s): Torstein Hønsi

by Luke Marlow

HTML

<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/maps/modules/data.js"></script>
<script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="https://code.highcharts.com/maps/modules/offline-exporting.js"></script>

<div id="container"></div>

CSS

#container {
    height: 500px; 
    min-width: 310px; 
    max-width: 800px; 
    margin: 0 auto; 
}
.loading {
    margin-top: 10em;
    text-align: center;
    color: gray;
}

JavaScript

// Prepare random data
var data = [
  ['GB-ABD', Math.floor(Math.random() * 100000)],
	['GB-ANS', Math.floor(Math.random() * 100000)],
  ['GB-BDF', Math.floor(Math.random() * 100000)],
  ['GB-WBK', Math.floor(Math.random() * 100000)],
  ['GB-BKM', Math.floor(Math.random() * 100000)],
  ['GB-CAM', Math.floor(Math.random() * 100000)],  
  ['GB-CHE', Math.floor(Math.random() * 100000)],
  ['GB-ABC', Math.floor(Math.random() * 100000)],
  ['GB-DUR', Math.floor(Math.random() * 100000)],
  ['GB-CMA', Math.floor(Math.random() * 100000)],  
  ['GB-DBY', Math.floor(Math.random() * 100000)],
  ['GB-DEV', Math.floor(Math.random() * 100000)],
	['GB-DOR', Math.floor(Math.random() * 100000)],
  ['GB-ESX', Math.floor(Math.random() * 100000)],
  ['GB-EDH', Math.floor(Math.random() * 100000)],
  ['GB-ESS', Math.floor(Math.random() * 100000)],
  ['GB-FIF', Math.floor(Math.random() * 100000)],
  ['GB-GLG', Math.floor(Math.random() * 100000)],
  ['GB-GLS', Math.floor(Math.random() * 100000)],
  ['GB-MAN', Math.floor(Math.random() * 100000)],
  ['GB-BGW', Math.floor(Math.random() * 100000)],
  ['GB-GWN', Math.floor(Math.random() * 100000)],
  ['GB-HAM', Math.floor(Math.random() * 100000)],
  ['GB-HRT', Math.floor(Math.random() * 100000)],
  ['GB-KEN', Math.floor(Math.random() * 100000)],
  ['GB-LAN', Math.floor(Math.random() * 100000)],
  ['GB-LCE', Math.floor(Math.random() * 100000)],
  ['GB-LIN', Math.floor(Math.random() * 100000)],
  ['GB-LND', Math.floor(Math.random() * 100000)],
  ['GB-NFK', Math.floor(Math.random() * 100000)],
  ['GB-NLK', Math.floor(Math.random() * 100000)],
  ['GB-NYK', Math.floor(Math.random() * 100000)],
  ['GB-RUD', Math.floor(Math.random() * 100000)],
  ['GB-NTH', Math.floor(Math.random() * 100000)],
  ['GB-NTT', Math.floor(Math.random() * 100000)],
  ['GB-OXF', Math.floor(Math.random() * 100000)],
  ['GB-SHR', Math.floor(Math.random() * 100000)],
	['GB-SOM', Math.floor(Math.random() * 100000)],
  ['GB-STS', Math.floor(Math.random() * 100000)],
 ...