Chartjs-Doughnut spacing

1πŸ‘

βœ…

In your graph options, set cutout: "95%" and borderRadius: 3 like this

const labelsd = <?php echo $jswallet;?>;
const data = {
    labels: labelsd,
    datasets: [
    {
        label: "Wallets",
        data: <?php echo $jsamount;?>,
        backgroundColor: [
            "#1D7A46",
            "#C724B1",
            "#c7243f",
            "#0E75F1",
            "#2E8B57"
        ],
        borderColor: [
            "#1D7A46",
            "#C724B1",
            "#c7243f",
            "#0E75F1",
            "#1D7A46"
        ],
        borderWidth: [1, 1, 1, 1, 1]
    }
    ]
};
const config = {
    type: 'doughnut',
    data: data,
    options: {
        cutout: "95%",
        borderRadius: 3,
        responsive: true,
        plugins: {
            legend:{display: false},
            title: {display: false,}
        }
    },
};
const minutedownloads = new Chart(
    document.getElementById('dailyspendings'),
    config
);

Leave a comment