var legendsector = {}; legendsector['B777'] = 2 legendsector['A320'] = 4 legendsector['Q400'] = 1 legendsector['A321'] = 3 legendsector['B788'] = 3 legendsector['B789'] = 2 legendsector['A380'] = 1 legendsector['A319'] = 1 $(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: [ ['B777',11.8], ['A320',23.5], ['Q400',5.9], ['A321',17.6], ['B788',17.6], ['B789',11.8], ['A380',5.9], ['A319',5.9] ] }] }); }); });