var legenddistance = {};
legenddistance['A319'] = 5870
legenddistance['A320'] = 7342
legenddistance['B737'] = 160
legenddistance['E170'] = 567
legenddistance['Twin Otter'] = 284
legenddistance['B767'] = 1117
legenddistance['E190'] = 1561
legenddistance['A321'] = 833
$(function () {
var chart;
$(document).ready(function() {
// Build the chart
chart = new Highcharts.Chart({
chart: {
renderTo: 'aircraft_distance',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: ''
},
tooltip: {
pointFormat: '{series.name}: {point.percentage}%',
percentageDecimals: 1
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return ''+ this.point.name +': '+ Math.round(this.percentage*10)/10 +' % (' + legenddistance[this.point.name].toLocaleString() + ')';
}
}
}
},
series: [{
type: 'pie',
name: 'Sectors by Aircraft',
data: [
['A319',33.1],
['A320',41.4],
['B737',0.9],
['E170',3.2],
['Twin Otter',1.6],
['B767',6.3],
['E190',8.8],
['A321',4.7]
]
}]
});
});
});