Highcharts Demo

author(s): Torstein Hønsi

by maritavindedal

HTML

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

<div id="container"></div>

CSS

#container {
    max-width: 800px;
    min-width: 360px;
    margin: 0 auto;
}

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'pie',
        spacingBottom: 50, // Adjust the spacing between the chart and other elements
    },
    title: {
        text: 'Pie Chart with Hole and More Spacing Between Series'
    },
    plotOptions: {
        pie: {
            innerSize: '60%', // Set the size of the hole in the middle
            depth: 45, // Adjust the depth of the pie chart
            dataLabels: {
                enabled: true,
                format: '{point.name}: {point.percentage:.1f}%'
            },
            point: {
                // Increase the sliced offset to create more spacing between series
                slicedOffset: 19
            }
        }
    },
    series: [{
        name: 'Data',
        data: [
            ['Category 1', 20],
            ['Category 2', 30],
            ['Category 3', 15],
            ['Category 4', 35]
        ]
    }]
});