Chartjs-Chartjs Doughnut cutout option not working

0👍

cutout is a property of a dataset. It can be set per dataset…

{
  type: 'doughnut',
  data: {
    datasets: [{
      cutout:'40%'
      ...
    },
    {
      cutout:'90%'
      ...
    }]
  }
}

…or (as you seem to want to do) for all datasets in the chart:

{
  type: 'doughnut',
  data: data,
  options: {
    datasets: {
      doughnut: {
        cutout:'90%'
      }
    }
  }
}

-1👍

Try this

chartOptions: ChartOptions<'doughnut'> = {
    scales: {
      x: {
        display: false,
      },
      y: {
        display: false
      }
    },
    plugins: {
      legend: {
        display: false
      },
      tooltip: {
        enabled: false
      }
    },
    cutout: '94%',
    responsive: false,
    maintainAspectRatio: false
  };

Leave a comment