var legenddistance = {}; legenddistance['A319'] = 2149 legenddistance['747-400'] = 5030 legenddistance['777-300'] = 3430 legenddistance['Unspecified'] = 3658 legenddistance['E170'] = 457 legenddistance['777-200'] = 7866 legenddistance['737-800'] = 7683 legenddistance['A330-200'] = 8140 legenddistance['A320'] = 2698 legenddistance['Dash 8-400Q'] = 869 legenddistance['A321'] = 457 legenddistance['737-900ER'] = 3293 $(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.7], ['747-400',11], ['777-300',7.5], ['Unspecified',8], ['E170',1], ['777-200',17.2], ['737-800',16.8], ['A330-200',17.8], ['A320',5.9], ['Dash 8-400Q',1.9], ['A321',1], ['737-900ER',7.2] ] }] }); }); });