I'm using Highmaps to show the number of relevant users from each individual country. This should then be displayed in a gradient, so that the more users there are from a country, the darker the color. I have it running in Highmaps so that it loads the data, but for some reason it's displaying all the countries in black, despite the gradient legend being white to blue. Any idea why that is? Thanks!
$(document).ready(function(){
// Basic highcharts initialization
Highcharts.setOptions({
lang: {
thousandsSep: ','
}
});
var analytics_map = new AnalyticsMap('#container');
analytics_map.setTitle('# of Signups');
analytics_map.load([
["AE","31"],
["AR","51"],
["AT","71"],
["AU","81"],
["BE","91"],
["BG","9"],
["BO","22"],
["BR","37"],
["US","173"],
["UY","5"],
["ZA","19"]
]);
function AnalyticsMap(selector){
this.selector = selector,
this.title = 'Default Title',
this.setTitle = function (title){
this.title = title;
},
this.load = function(data){
$(this.selector).highcharts('Map', {
title: {
text: this.title
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
},
series: [{
data: data,
mapData: Highcharts.maps['custom/world'],
joinBy: ['iso-a2', 0],
keys: ['iso-a2', 'value'],
name: this.title,
dataLabels: {
//enabled: true,
//format: '{point.code}'
},
tooltip: {
pointFormat: '{point.iso-a2}: {point.value} signups'
}
}]
});
}
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/world.js"></script>
<div id="container"></div>