var legenddistance = {};
legenddistance['A320'] = 2814
legenddistance['A332'] = 2198
legenddistance['A343'] = 4551
legenddistance['A333'] = 418
legenddistance['A319'] = 3122
legenddistance['B773'] = 1055
legenddistance['B744'] = 5980
legenddistance['B737'] = 1847
$(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: [
['A320',12.8],
['A332',10],
['A343',20.7],
['A333',1.9],
['A319',14.2],
['B773',4.8],
['B744',27.2],
['B737',8.4]
]
}]
});
});
});