[Chartjs]-Inner Radius is not changed in Chart.js (Doughnut Chart)

11๐Ÿ‘

โœ…

You should use percentageInnerCutout property in options object

let options = {
  circumference: Math.PI,
  rotation: 1.0 * Math.PI,
  percentageInnerCutout: 10,
  legend: {
    display: false
  },
  layout:{
    padding:40
  }, 
}

You can also check this question How to vary the thickness of doughnut chart, using ChartJs.?

P.S. As I understand it depends of version, so

If Chart.js version > 2.0 use cutoutPercentage

Otherwise use percentageInnerCutout

2๐Ÿ‘

In chart JS 2.0 it should look like this

var options = {        
    cutoutPercentage: 40
};

CodePen: https://codepen.io/anon/pen/VVeOZZ?editors=0010

Leave a comment