polygon label in polygon chart - Javascript highcharts

Javascript examples for highcharts:Chart Configuration

Description

polygon label in polygon 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() {/*  w w  w . j a  va 2s. c  om*/
  $('#container').highcharts({
    series: [{
      name: 'Target',
      type: 'polygon',
      data: [
        [153, 42],
        [149, 46],
        [149, 55],
        [152, 60],
        [159, 70],
        [170, 77],
        [180, 70],
        [180, 60],
        [173, 52],
        [166, 45]
      ],
    }],
  }, function(chart) {
    var xAxis = chart.xAxis[0],
      yAxis = chart.yAxis[0];
    chart.renderer.label('Target', xAxis.toPixels(165), yAxis.toPixels(60)).attr({
      zIndex: 10,
      'text-anchor': 'middle'
    }).add()
  });
});

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

Related Tutorials