var legenddistance = {}; legenddistance['B777'] = 7107 legenddistance['A320'] = 2208 legenddistance['Q400'] = 552 legenddistance['A321'] = 2656 legenddistance['B788'] = 12833 legenddistance['B789'] = 5589 legenddistance['A380'] = 3243 legenddistance['A319'] = 276 $(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',20.6], ['A320',6.4], ['Q400',1.6], ['A321',7.7], ['B788',37.2], ['B789',16.2], ['A380',9.4], ['A319',0.8] ] }] }); }); });