var legenddistance = {}; legenddistance['A320'] = 13769 legenddistance['E190'] = 2174 legenddistance['A319'] = 5187 legenddistance['777-200ER'] = 4348 legenddistance['747-400'] = 11290 legenddistance['E170'] = 305 legenddistance['A321'] = 763 legenddistance['737-700'] = 343 $(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: [ ['A320',36.1], ['E190',5.7], ['A319',13.6], ['777-200ER',11.4], ['747-400',29.6], ['E170',0.8], ['A321',2], ['737-700',0.9] ] }] }); }); });