var legenddistance = {}; legenddistance['B733'] = 5284 legenddistance['F100'] = 3761 legenddistance['Dash 8-300'] = 1343 legenddistance['B735'] = 1702 legenddistance['A319'] = 3851 legenddistance['A321'] = 1343 legenddistance['A306'] = 896 legenddistance['CRJ'] = 5015 legenddistance['CR7'] = 985 legenddistance['B738'] = 11822 legenddistance['TU5'] = 2060 legenddistance['B73G'] = 4299 legenddistance['AR8'] = 448 legenddistance['ER4'] = 716 legenddistance['A320'] = 14061 legenddistance['AT7'] = 627 legenddistance['B752'] = 1881 legenddistance['M82'] = 2060 legenddistance['BAe146'] = 448 legenddistance['AR1'] = 896 legenddistance['Dash 8-400'] = 537 legenddistance['B763'] = 6090 legenddistance['Unspecified'] = 19345 $(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: [ ['B733',5.9], ['F100',4.2], ['Dash 8-300',1.5], ['B735',1.9], ['A319',4.3], ['A321',1.5], ['A306',1], ['CRJ',5.6], ['CR7',1.1], ['B738',13.2], ['TU5',2.3], ['B73G',4.8], ['AR8',0.5], ['ER4',0.8], ['A320',15.7], ['AT7',0.7], ['B752',2.1], ['M82',2.3], ['BAe146',0.5], ['AR1',1], ['Dash 8-400',0.6], ['B763',6.8], ['Unspecified',21.6] ] }] }); }); });