Jugal | Percentage in Pie | Highcharts & Highstock

http://stackoverflow.com/questions/12529934/displaying-percentage-inside-pie-item-for-highcharts http://jugal.me/ Jugal Thakkar

by arvillarruel

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px">

JavaScript

$(function () {
    Highcharts.chart('container',{
        chart: {
            
           type:'pie'
        },
       
        
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                    formatter: function() {
                        return Math.round(this.percentage*100)/100 + ' %';
                    },
                    distance: -30,
                    color:'white'
                }
            }
        },
        
        series: [{
            data: [
            ['Disponibles',   10.38],
            ['Adquiridas',       56.33],
            ['Usadas', 24.03],],
             showInLegend: true,
        }]
    });
});