Highcharts Demo

author(s): Øystein Moseng

by koh_edwin

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>

CSS

#container {
    min-width: 300px;
    max-width: 400px;
    height: 500px;
    margin: 1em auto;
}

JavaScript

Highcharts.chart('container', {

    chart: {
        type: 'bar'
    },

    title: {
        text: 'Multiple datalabels per point'
    },

    plotOptions: {
        series: {
            dataLabels: {
                enabled: true,
                align: 'left',
            position:"right",
            format: '{y} points'
            }
        }
    },

    xAxis: {
        type: 'category',
        lineWidth: 0,
        tickWidth: 0
    },

    yAxis: {
        title: {
            text: ''
        }
    },

    series: [
    {
        //dataLabels: [ {
        //    align: 'left',
        //    position:"right",
        //    format: '{y} points'
        //}],
        data: [{
            y: 143,
            name: 'Gabriel',
            age: 12,
            dataLabels: {
                color: '#ec0000'
            }
        }, {
            y: 121,
            name: 'Marie',
            age: 14,
            group: ''
        }, {
            y: 111,
            name: 'Adam',
            age: 13
        }, {
            y: 127,
            name: 'Camille',
            age: 11
        }, {
            y: 116,
            name: 'Paul',
            age: 12
        }, {
            y: 119,
            name: 'Laura',
            age: 14
        }, {
            y: 124,
            name: 'Louis',
            age: 14
        }],
        showInLegend: false
    }]

});