Set plot option for series - Javascript highcharts

Javascript examples for highcharts:Chart Series

Description

Set plot option for series

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() {/*  w  w  w . ja  v  a 2s  .co  m*/
  $('#container').highcharts({
    chart: {
      type: 'bar'
    },
    xAxis: {
      categories: ['Jan', 'Feb', 'Mar']
    },
    legend: {
      reversed: true
    },
    plotOptions: {
      series: {
        colorByPoint: true,
        dataLabels: {
          enabled: true,
          formatter: function() {
            return '<span style="white-space:pre;">' + this.key + '         x' + '</span>';
          },
          align: 'left',
          inside: true,
          x: -65
        }
      }
    },
    series: [{
      name: 'Tokyo',
      color: 'grey',
      data: [5, 6, 7]
    }, {
      name: 'NYC',
      color: 'grey',
      data: [10, 10, -0.1]
    }]
  });
});

      </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="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials