var legenddistance = {}; legenddistance['E145'] = 178 legenddistance['A319'] = 146 legenddistance['A333'] = 6717 legenddistance['B77W'] = 243 legenddistance['A346'] = 243 legenddistance['B738'] = 1266 legenddistance['A320'] = 665 legenddistance['A321'] = 292 legenddistance['B772'] = 3261 legenddistance['A332'] = 3213 $(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: [ ['E145',1.1], ['A319',0.9], ['A333',41.4], ['B77W',1.5], ['A346',1.5], ['B738',7.8], ['A320',4.1], ['A321',1.8], ['B772',20.1], ['A332',19.8] ] }] }); }); });