Label individual bars in grouped bar graph

by supertrue

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

JavaScript

$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
    
            chart: {
                renderTo: 'container',
                type: 'column'
            },
    
            title: {
                text: 'Total fruit consumtion, grouped by gender'
            },
    
            xAxis: [{
              offset: 20,
              lineWidth: 0,
              tickLength: 0,
              labels: {
                  style: { color: 'red', fontWeight: 'bold' }
              },
              categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
            }, {
                linkedTo: 0,
                opposite: false,
                offset: 0,
                labels: {
                    x: -10,
                    align: 'right',
                    formatter: function(){ return "Male" }
                }
            }, {
                linkedTo: 0,
                opposite: false,
                offset: 0,
                labels: {
                    align: 'left',
                    x: 10,
                    formatter: function(){ return "Female" }
                }
            }],
    
            plotOptions: {
                column: {
                    stacking: 'normal',
                    dataLabels: {
                        enabled: true,
                        color: 'white',
                        backgroundColor: 'rgba(0, 0, 0, 0.5)',
                        borderRadius: 6
                    }
                }
            },
    
            series: [{
                name: 'John',
                data: [5, 3, 4, 7, 2],
                stack: 'male'
            }, {
                name: 'Joe',
                data: [3, 4, 4, 2, 5],
                stack: 'male'
            }, {
                name: 'Jane',
                data: [2, 5, 6, 2, 1],
                stack: 'female'
            }, {
                name: 'Janet',
                data: [3, 0, 4, 4, 3],
     ...