var legendsector = {}; legendsector['A321'] = 1 legendsector['A320'] = 1 legendsector['747'] = 2 legendsector['757'] = 4 legendsector['MD80'] = 1 legendsector['777'] = 2 legendsector['737'] = 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: [ ['A321',8.3], ['A320',8.3], ['747',16.7], ['757',33.3], ['MD80',8.3], ['777',16.7], ['737',8.3] ] }] }); }); });