var legendsector = {}; legendsector['A321'] = 2 legendsector['A320'] = 4 legendsector['Saab 340'] = 1 legendsector['E190'] = 1 legendsector['737-900'] = 1 legendsector['737-800'] = 3 legendsector['A319'] = 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: [ ['A321',14.3], ['A320',28.6], ['Saab 340',7.1], ['E190',7.1], ['737-900',7.1], ['737-800',21.4], ['A319',14.3] ] }] }); }); });