CEO Donut

by Danielle Parkinson

HTML

<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; margin: 0 auto"></div>

JavaScript

$(function () {

    // Radialize the colors
    Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function (color) {
        return {
            radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
            stops: [
                [0, color],
                [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
            ]
        };
    });

    // Build the chart
    $('#container').highcharts({
        chart: {
            width: 350,
            height: 350,
            backgroundColor: '#201f2d'
        },
        exporting: { enabled: false },
        colors: [
            '#00a3a1',
            '#bc204b',
        ],
        credits: {
            enabled: false
        },
        title: {
            text: ' '
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                innerSize: '90%',
                borderWidth: 0,
                dataLabels: {
                    enabled: false,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                    style: {
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                    },
                    connectorColor: 'silver'
                },
                showInLegend: true
            }
        },
        legend: {
            enabled: true,
            verticalAlign: 'middle',
            align: 'right',
            itemStyle: {
                color: '#fff',
                fontWeight: 'normal',
                fontFamily: 'Chivo',
                fontSize: '14px',
            },
            layout: 'vertical'
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            data: [
                ['Complete', 49],
                ['In Progress', 51],
           ...