var legenddistance = {}; legenddistance['Boeing 777-300ER'] = 22209 legenddistance['Airbus A319-100'] = 177 legenddistance['Boeing 767-300ER'] = 5619 legenddistance['Cessna 172'] = 133 legenddistance['Boeing 737-900'] = 664 legenddistance['Boeing 737-800W'] = 354 legenddistance['Airbus A330-300'] = 5973 legenddistance['Boeing 737-800'] = 1018 legenddistance['Airbus A320'] = 354 legenddistance['Airbus A350-900'] = 7654 legenddistance['DH-6 Twin Otter'] = 133 $(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: [ ['Boeing 777-300ER',50.2], ['Airbus A319-100',0.4], ['Boeing 767-300ER',12.7], ['Cessna 172',0.3], ['Boeing 737-900',1.5], ['Boeing 737-800W',0.8], ['Airbus A330-300',13.5], ['Boeing 737-800',2.3], ['Airbus A320',0.8], ['Airbus A350-900',17.3], ['DH-6 Twin Otter',0.3] ] }] }); }); });