var legenddistance = {}; legenddistance['E190'] = 1309 legenddistance['A319'] = 9800 legenddistance['A320'] = 6981 legenddistance['A321'] = 3323 legenddistance['A320neo'] = 1074 legenddistance['ERJ-190'] = 201 legenddistance['A330'] = 1141 legenddistance['A318'] = 3457 legenddistance['B737-8'] = 1510 legenddistance['B767'] = 1108 legenddistance['B747'] = 3457 legenddistance['E170'] = 201 $(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: [ ['E190',3.9], ['A319',29.2], ['A320',20.8], ['A321',9.9], ['A320neo',3.2], ['ERJ-190',0.6], ['A330',3.4], ['A318',10.3], ['B737-8',4.5], ['B767',3.3], ['B747',10.3], ['E170',0.6] ] }] }); }); });