var legendsector = {}; legendsector['A330'] = 2 legendsector['B777'] = 4 legendsector['EMB170'] = 1 legendsector['A320'] = 2 legendsector['A319'] = 1 legendsector['E170'] = 1 legendsector['A321'] = 1 legendsector['B747'] = 2 legendsector['B767'] = 1 legendsector['B47'] = 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: [ ['A330',12.5], ['B777',25], ['EMB170',6.2], ['A320',12.5], ['A319',6.2], ['E170',6.2], ['A321',6.2], ['B747',12.5], ['B767',6.2], ['B47',6.2] ] }] }); }); });