var legenddistance = {}; legenddistance['A319'] = 1527 legenddistance['A321'] = 5525 legenddistance['A320'] = 7501 legenddistance['777-200ER'] = 6917 legenddistance['777-300ER'] = 10600 legenddistance['E190'] = 2111 legenddistance['E195-E2'] = 898 legenddistance['737-800'] = 1707 legenddistance['A350-1000'] = 4177 legenddistance['787-10'] = 3234 legenddistance['737-700'] = 719 $(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: [ ['A319',3.4], ['A321',12.3], ['A320',16.7], ['777-200ER',15.4], ['777-300ER',23.6], ['E190',4.7], ['E195-E2',2], ['737-800',3.8], ['A350-1000',9.3], ['787-10',7.2], ['737-700',1.6] ] }] }); }); });