Create Pie Chart with plot option - Javascript highcharts

Javascript examples for highcharts:Pie Chart

Description

Create Pie Chart with plot option

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 w w  w .ja v  a 2s  . c o  m*/
    var chart;
    $(document).ready(function () {
        // Build the chart
        $('#Chart').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text:'Time-Off Request'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage}%</b>',
                percentageDecimals: 2
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: false
                    },
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: 'Time-Off Request Details',
                data: [
                    ['Vacation', 45.0],
                    ['Time-Off', 26.8],
                    ['Sick Time',12.8],
                    ['Personal', 8.5],
                    ['Bereavement', 6.2],
                    ['Others', 0.7]
                ]
            }]
        });
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="Chart" style="min-width:400px"></div>  
   </body>
</html>

Related Tutorials