var legenddistance = {}; legenddistance['B737-800'] = 973 legenddistance['A330-200'] = 425 legenddistance['A320-200'] = 5498 legenddistance['B737-900'] = 425 legenddistance['A330-300'] = 6375 $(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: [ ['B737-800',7.1], ['A330-200',3.1], ['A320-200',40.1], ['B737-900',3.1], ['A330-300',46.5] ] }] }); }); });