Highcharts Demo

author(s): Torstein Hønsi

by Joanna Sobańska

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-3d.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

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

JavaScript

Highcharts.getOptions().plotOptions.pie.colors = (function () {
    var colors = [],
        base = Highcharts.getOptions().colors[0],
        i;

    for (i = 0; i < 10; i += 1) {
        // Start out with a darkened base color (negative brighten), and end
        // up with a much brighter color
        colors.push("#2eb2ff","#96fda4")
    }
    return colors;
    
}());


Highcharts.chart('container', {
    chart: {
        type: 'pie',
        options3d: {
            enabled: true,
            alpha: 45,
            beta: 0
        },
       backgroundColor: null,
       plotshadow: true,
       plotBorderWidth: null
    },
       title: {
        text: ' '
    },
     tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            depth: 50,
            dataLabels: {
                enabled:false,
                format: '<b>{point.name}</b>: {point.percentage:.1f} %',
            }
        }
    },
    series: [{
        type: 'pie',
        name: 'Browser share',
        data: [
           
            {
                name: 'Solar',
                y: 20,
                sliced: true,
                selected: true
            },
             { name: "FOURNISSEUR D'ELECTRICITE", y:80}

        ]
    }]
});