var legenddistance = {};
legenddistance['A321'] = 596
legenddistance['A320'] = 4013
legenddistance['Saab 340'] = 274
legenddistance['E190'] = 353
legenddistance['737-900'] = 321
legenddistance['737-800'] = 1779
legenddistance['A319'] = 502
$(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: [
['A321',7.6],
['A320',51.2],
['Saab 340',3.5],
['E190',4.5],
['737-900',4.1],
['737-800',22.7],
['A319',6.4]
]
}]
});
});
});