var legenddistance = {}; legenddistance['A330'] = 6532 legenddistance['B777'] = 23020 legenddistance['EMB170'] = 225 legenddistance['A320'] = 450 legenddistance['A319'] = 225 legenddistance['E170'] = 225 legenddistance['A321'] = 225 legenddistance['B747'] = 7118 legenddistance['B767'] = 3649 legenddistance['B47'] = 3424 $(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: [ ['A330',14.5], ['B777',51.1], ['EMB170',0.5], ['A320',1], ['A319',0.5], ['E170',0.5], ['A321',0.5], ['B747',15.8], ['B767',8.1], ['B47',7.6] ] }] }); }); });