Move label above bar in bar chart - Javascript highcharts

Javascript examples for highcharts:Bar Chart

Description

Move label above bar in bar chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {/* www  .  ja va  2  s  .  c  o  m*/
    $('#container').highcharts({
        chart: {
            type: 'bar'
        },
        xAxis: {
            categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
            labels: {
                enabled: false
            }
        },
        plotOptions: {
            bar: {
                dataLabels: {
                    enabled: true,
                    format: '{key}',
                    inside: true,
                    align: 'left',
                    crop: false,
                    overflow: 'none',
                    y: -20
                }
            }
        },
        series: [{
            data: [107, 31, 635, 203, 2]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="width: 500px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials