var legenddistance = {}; legenddistance['A320'] = 6080 legenddistance['A319'] = 1964 legenddistance['A320N'] = 935 legenddistance['320'] = 326 legenddistance['78M'] = 609 legenddistance['Unspecified'] = 588 $(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',57.9], ['A319',18.7], ['A320N',8.9], ['320',3.1], ['78M',5.8], ['Unspecified',5.6] ] }] }); }); });