Highcharts Demo

author(s): Torstein Hønsi

by aaewong

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>

JavaScript

$(function () {
    $('#container').highcharts({

      	chart : {
          type: 'column'
        },
        title: {
            text: 'Data labels box options'
        },

        subtitle: {
            text: 'backgroundColor, borderColor, borderRadius, borderWidth, padding and shadow'
        },

        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                  	allowOverlap: false,
                    borderRadius: 5,
                    backgroundColor: 'rgba(252, 255, 197, 0.7)',
                    borderWidth: 1,
                    borderColor: '#AAA',
                  	padding : -5, 
                    y: -6,
                  	style: {
                        fontWeight: 'bold',
                      	fontSize: '12px'
                    }
                }
            }
        },

        series: [{
            data: [29.901, 71.501, 106.401, 129.201, 144.001, 178.01, 135.61, 148.51, {
                y: 216.4,
                dataLabels: {
                    borderColor: 'red',
                    borderWidth: 2,
                    shadow: true,
                }
            }, 194.10, 95.60, 54.40]
        }]

    });
});