var legenddistance = {}; legenddistance['777'] = 32082 legenddistance['Unspecified'] = 236970 legenddistance['744'] = 4375 legenddistance['747-400'] = 35728 legenddistance['A319'] = 365 legenddistance['A346'] = 10937 legenddistance['767'] = 365 legenddistance['757'] = 2187 legenddistance['A320'] = 0 legenddistance['737'] = 365 legenddistance['777-200'] = 17135 legenddistance['319'] = 729 legenddistance['320'] = 2187 legenddistance['747'] = 6562 legenddistance['787-9'] = 3281 legenddistance['A380'] = 11302 $(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: [ ['777',8.8], ['Unspecified',65], ['744',1.2], ['747-400',9.8], ['A319',0.1], ['A346',3], ['767',0.1], ['757',0.6], ['A320',0], ['737',0.1], ['777-200',4.7], ['319',0.2], ['320',0.6], ['747',1.8], ['787-9',0.9], ['A380',3.1] ] }] }); }); });