var legenddistance = {}; legenddistance['A320'] = 391 legenddistance['A319'] = 5085 legenddistance['A321'] = 2999 legenddistance['734'] = 1565 legenddistance['A332'] = 19167 legenddistance['777'] = 1825 legenddistance['Unspecified'] = 84751 legenddistance['757'] = 1825 legenddistance['733'] = 1304 legenddistance['CRJ7'] = 652 legenddistance['744'] = 5476 legenddistance['CRJ'] = 391 legenddistance['330'] = 3781 legenddistance['146'] = 1434 $(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',0.3], ['A319',3.9], ['A321',2.3], ['734',1.2], ['A332',14.7], ['777',1.4], ['Unspecified',65], ['757',1.4], ['733',1], ['CRJ7',0.5], ['744',4.2], ['CRJ',0.3], ['330',2.9], ['146',1.1] ] }] }); }); });