var legenddistance = {}; legenddistance['320'] = 6718 legenddistance['Eurostar'] = 413 legenddistance['744'] = 42788 legenddistance['738'] = 413 legenddistance['763'] = 2584 legenddistance['743'] = 2067 legenddistance['772'] = 9508 legenddistance['319'] = 1240 legenddistance['735'] = 723 legenddistance['AR1'] = 723 legenddistance['752'] = 5994 legenddistance['CRJ'] = 413 legenddistance['346'] = 11265 legenddistance['388'] = 13539 legenddistance['773'] = 4754 legenddistance['321'] = 413 $(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: [ ['320',6.5], ['Eurostar',0.4], ['744',41.4], ['738',0.4], ['763',2.5], ['743',2], ['772',9.2], ['319',1.2], ['735',0.7], ['AR1',0.7], ['752',5.8], ['CRJ',0.4], ['346',10.9], ['388',13.1], ['773',4.6], ['321',0.4] ] }] }); }); });