var legenddistance = {}; legenddistance['B744'] = 12951 legenddistance['B738'] = 1220 legenddistance['MD80'] = 697 legenddistance['B763'] = 1220 legenddistance['B762'] = 9902 legenddistance['A319'] = 348 legenddistance['CR2'] = 377 legenddistance['B752'] = 1684 legenddistance['E140'] = 319 legenddistance['B733'] = 348 $(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: [ ['B744',44.6], ['B738',4.2], ['MD80',2.4], ['B763',4.2], ['B762',34.1], ['A319',1.2], ['CR2',1.3], ['B752',5.8], ['E140',1.1], ['B733',1.2] ] }] }); }); });