bar data labels position for bar chart - Javascript highcharts

Javascript examples for highcharts:Bar Chart

Description

bar data labels position for bar chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {//from   ww w  .j  av a  2s  .  c  o m
    $('#container').highcharts({
        chart: {
            type: "bar",
            height: 150,
            events: {
                redraw: function () {
                    //$(window).trigger('resize');
                },
                load: function () {
                    //$(window).trigger('resize');
                }
            }
        },
        title: {
            text: null
        },
        xAxis: {
            labels: {
                enabled: false
            },
            title: {
                text: null
            },
            lineWidth: 0,
            minorGridLineWidth: 0,
            lineColor: "transparent",
            minorTickLength: 0,
            tickLength: 0,
            gridLineColor: "transparent",
        },
        yAxis: {
            title: {
                text: null
            },
            labels: {
                enabled: false
            },
            lineWidth: 0,
            minorGridLineWidth: 0,
            lineColor: "transparent",
            minorTickLength: 0,
            tickLength: 0,
            gridLineColor: "transparent"
        },
        tooltip: {
            enabled: false
        },
        plotOptions: {
            bar: {
                dataLabels: {
                    enabled: true,
                    useHTML: true,
                    formatter: function () {
                        return this.series.name + "<span style='color:#0D2A4D; opacity:0.5;'> (" + this.y + "%) </span>";
                    }
                }
            },
            series: {
                groupPadding: 0,
                minPointLength: 20,
                pointPadding: 0.4,
                pointWidth: 10
            }
        },
        legend: {
            enabled: false
        },
        credits: {
            enabled: false
        },
        series: [{
            "name": "Missing",
                "data": [20.75]
        }, {
            "name": "English",
                "data": [77.91]
        }, {
            "name": "Spanish",
                "data": [0.02]
        }, {
            "name": "Arabic",
                "data": [0.31]
        }, {
            "name": "Chinese",
                "data": [0.01]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container" style="height:500px;"></div>  
   </body>
</html>

Related Tutorials