JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function() {
var chart,
list = {},
items = [];
$.getJSON('http://fronteers.nl/congres/2011/attendees.json', function(data) {
$.each(data.fronteers2012.andAllTheirOtherData, function(){
if (!list[this.country]) {
list[this.country] = 0;
}
list[this.country]++
});
$.each(list, function(k, v) {
items.push([k, v]);
});
makeChart(items);
});
function makeChart(data) {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Fronteers 2012 by Country'
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '
+ this.percentage.toFixed(2) +' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '<b>'+ this.point.name +'</b>: '
+ this.percentage.toFixed(2) +' %';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: data
}]
});
}
});