change legends position in pie chart - Javascript highcharts

Javascript examples for highcharts:Pie Chart

Description

change legends position in pie 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"> 
   </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; height: 400px; max-width: 600px; margin: 0 auto"></div> 
      <script type="text/javascript">
Highcharts.chart('container', {
   legend: {//from  w  w w  .  java 2  s  .  co m
     layout: 'vertical',
     align: 'right',
     verticalAlign: 'middle',
     itemMarginTop: 10,
     itemMarginBottom: 10
   },
    series: [{
        showInLegend: true,
        dataLabels: {enabled: false},
        type: 'pie',
        colorByPoint: true,
        data: [{
            name: 'Microsoft Internet Explorer',
            y: 56.33
        }, {
            name: 'Chrome',
            y: 24.03,
            sliced: true,
            selected: true
        }, {
            name: 'Firefox',
            y: 10.38
        }, {
            name: 'Safari',
            y: 4.77
        }, {
            name: 'Opera',
            y: 0.91
        }, {
            name: 'Proprietary or Undetectable',
            y: 0.2
        }]
    }]
});

      </script>  
   </body>
</html>

Related Tutorials