var legendsector = {}; legendsector['A320'] = 2 legendsector['A319'] = 5 legendsector['A321'] = 4 legendsector['734'] = 1 legendsector['A332'] = 5 legendsector['777'] = 1 legendsector['Unspecified'] = 73 legendsector['757'] = 1 legendsector['733'] = 1 legendsector['CRJ7'] = 1 legendsector['744'] = 1 legendsector['CRJ'] = 1 legendsector['330'] = 1 legendsector['146'] = 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: [ ['A320',2], ['A319',5.1], ['A321',4], ['734',1], ['A332',5.1], ['777',1], ['Unspecified',73.7], ['757',1], ['733',1], ['CRJ7',1], ['744',1], ['CRJ',1], ['330',1], ['146',2] ] }] }); }); });