var legenddistance = {};
legenddistance['Airbus A319'] = 2245
legenddistance['Airbus A321'] = 14825
legenddistance['Boeing 767'] = 4744
legenddistance['Airbus A320'] = 2584
legenddistance['Boeing 787'] = 17578
legenddistance['Boeing 737'] = 424
$(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: [
['Airbus A319',5.3],
['Airbus A321',35],
['Boeing 767',11.2],
['Airbus A320',6.1],
['Boeing 787',41.5],
['Boeing 737',1]
]
}]
});
});
});