var legenddistance = {}; legenddistance['B777'] = 12839 legenddistance['B787'] = 35120 legenddistance['A320'] = 1902 legenddistance['A330'] = 3532 legenddistance['B757'] = 1087 legenddistance['A350'] = 6182 legenddistance['E175'] = 1223 legenddistance['A319'] = 272 legenddistance['A340'] = 5706 $(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: [ ['B777',18.9], ['B787',51.7], ['A320',2.8], ['A330',5.2], ['B757',1.6], ['A350',9.1], ['E175',1.8], ['A319',0.4], ['A340',8.4] ] }] }); }); });