var legenddistance = {}; legenddistance['Unspecified'] = 88667 legenddistance['CRJ-1000'] = 224 legenddistance['A330-200'] = 1681 legenddistance['Batavia Air'] = 1681 legenddistance['A330-300'] = 8519 legenddistance['miss fligt'] = 448 legenddistance['miss flight'] = 897 legenddistance['B777-300'] = 9976 $(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: [ ['Unspecified',79.1], ['CRJ-1000',0.2], ['A330-200',1.5], ['Batavia Air',1.5], ['A330-300',7.6], ['miss fligt',0.4], ['miss flight',0.8], ['B777-300',8.9] ] }] }); }); });