var legenddistance = {}; legenddistance['A319'] = 2142 legenddistance['747-400'] = 5047 legenddistance['777-300'] = 3428 legenddistance['Unspecified'] = 3618 legenddistance['E170'] = 476 legenddistance['777-200'] = 7903 legenddistance['737-800'] = 7665 legenddistance['A330-200'] = 8141 legenddistance['A320'] = 2714 legenddistance['Dash 8-400Q'] = 857 legenddistance['A321'] = 476 legenddistance['737-900ER'] = 3285 legenddistance['A220-200'] = 1857 $(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: [ ['A319',4.5], ['747-400',10.6], ['777-300',7.2], ['Unspecified',7.6], ['E170',1], ['777-200',16.6], ['737-800',16.1], ['A330-200',17.1], ['A320',5.7], ['Dash 8-400Q',1.8], ['A321',1], ['737-900ER',6.9], ['A220-200',3.9] ] }] }); }); });