var legenddistance = {}; legenddistance['A320'] = 9441 legenddistance['737-800'] = 2811 legenddistance['737-700'] = 1385 legenddistance['Unspecified'] = 755 legenddistance['747-400'] = 13762 legenddistance['A380-800'] = 6839 legenddistance['A321'] = 2517 legenddistance['A319'] = 4406 $(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',22.5], ['737-800',6.7], ['737-700',3.3], ['Unspecified',1.8], ['747-400',32.8], ['A380-800',16.3], ['A321',6], ['A319',10.5] ] }] }); }); });