var legenddistance = {}; legenddistance['A320'] = 4172 legenddistance['A321'] = 13028 legenddistance['A319'] = 1448 legenddistance['B772'] = 10303 legenddistance['B789'] = 14220 legenddistance['B38M'] = 1618 legenddistance['B39M'] = 1448 legenddistance['B77W'] = 16349 legenddistance['A35K'] = 10984 legenddistance['A332'] = 426 legenddistance['A333'] = 426 legenddistance['B738'] = 1362 legenddistance['B788'] = 5535 legenddistance['CRJ9'] = 341 legenddistance['B739'] = 3576 $(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',4.9], ['A321',15.3], ['A319',1.7], ['B772',12.1], ['B789',16.7], ['B38M',1.9], ['B39M',1.7], ['B77W',19.2], ['A35K',12.9], ['A332',0.5], ['A333',0.5], ['B738',1.6], ['B788',6.5], ['CRJ9',0.4], ['B739',4.2] ] }] }); }); });