var legenddistance = {}; legenddistance['A320'] = 4632 legenddistance['A319'] = 1345 legenddistance['A321'] = 448 legenddistance['A388'] = 5977 legenddistance['BB73'] = 1046 legenddistance['A333'] = 797 legenddistance['B772'] = 5977 legenddistance['A359'] = 12501 legenddistance['B77W'] = 9164 legenddistance['B788'] = 7869 $(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',9.3], ['A319',2.7], ['A321',0.9], ['A388',12], ['BB73',2.1], ['A333',1.6], ['B772',12], ['A359',25.1], ['B77W',18.4], ['B788',15.8] ] }] }); }); });