var legenddistance = {}; legenddistance['737'] = 300388 legenddistance['Unspecified'] = 39525 legenddistance['772'] = 106717 legenddistance['773'] = 129641 legenddistance['744'] = 25296 legenddistance['320'] = 86954 legenddistance['388'] = 52963 legenddistance['767'] = 33991 legenddistance['321'] = 790 legenddistance['763'] = 1581 legenddistance['Q300'] = 4743 legenddistance['ATR'] = 0 legenddistance['345'] = 7114 legenddistance['1900D'] = 0 legenddistance['ATR72'] = 0 legenddistance['757'] = 790 $(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: [ ['737',38], ['Unspecified',5], ['772',13.5], ['773',16.4], ['744',3.2], ['320',11], ['388',6.7], ['767',4.3], ['321',0.1], ['763',0.2], ['Q300',0.6], ['ATR',0], ['345',0.9], ['1900D',0], ['ATR72',0], ['757',0.1] ] }] }); }); });