var legendsector = {}; legendsector['Airbus A319'] = 6 legendsector['Airbus A321'] = 11 legendsector['Boeing 767'] = 4 legendsector['Airbus A320'] = 7 legendsector['Boeing 787'] = 8 legendsector['Boeing 737'] = 2 $(function () { var chart; $(document).ready(function() { // Build the chart chart = new Highcharts.Chart({ chart: { renderTo: 'aircraft_sector', 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 +' % (' + legendsector[this.point.name].toLocaleString() + ')'; } } } }, series: [{ type: 'pie', name: 'Sectors by Aircraft', data: [ ['Airbus A319',15.8], ['Airbus A321',28.9], ['Boeing 767',10.5], ['Airbus A320',18.4], ['Boeing 787',21.1], ['Boeing 737',5.3] ] }] }); }); });