var legendsector = {}; legendsector['A320'] = 8 legendsector['A319'] = 6 legendsector['A321'] = 2 legendsector['A388'] = 1 legendsector['BB73'] = 1 legendsector['A333'] = 2 legendsector['B772'] = 1 legendsector['A359'] = 2 legendsector['B77W'] = 2 legendsector['B788'] = 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',29.6], ['A319',22.2], ['A321',7.4], ['A388',3.7], ['BB73',3.7], ['A333',7.4], ['B772',3.7], ['A359',7.4], ['B77W',7.4], ['B788',7.4] ] }] }); }); });