var legenddistance = {}; legenddistance['Q300'] = 3277 legenddistance['733'] = 17476 legenddistance['ATR 72'] = 4525 legenddistance['772'] = 12483 legenddistance['320'] = 5305 legenddistance['744'] = 17944 legenddistance['763'] = 24030 legenddistance['1900D'] = 936 legenddistance['333'] = 12171 legenddistance['A320'] = 10767 legenddistance['738'] = 13887 legenddistance['ATR72'] = 2965 legenddistance['789'] = 16228 legenddistance['332'] = 1716 legenddistance['Q400'] = 312 legenddistance['A333'] = 936 legenddistance['A350-900'] = 5617 legenddistance['773'] = 5617 $(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: [ ['Q300',2.1], ['733',11.2], ['ATR 72',2.9], ['772',8], ['320',3.4], ['744',11.5], ['763',15.4], ['1900D',0.6], ['333',7.8], ['A320',6.9], ['738',8.9], ['ATR72',1.9], ['789',10.4], ['332',1.1], ['Q400',0.2], ['A333',0.6], ['A350-900',3.6], ['773',3.6] ] }] }); }); });