After thoroughly reading the Chart.js documentation, I didn't find any method to get the innerRadius of a doughnut chart.
This is one of the many issues I found after migrating from Chart.js 2.x to 3.x
In Chart.js 2.x, to get the inner radius of a doughnut chart, I would do:
beforeDatasetsUpdate: c => {
const radius = c.innerRadius;
}
Now, in Chart.js 3.x, I found it deeply nested in :
beforeDatasetsUpdate: c => {
const radius = c._metasets[0].data[0].innerRadius;
}
The official migration guide says:
Chart.innerRadius now lives on doughnut, pie, and polarArea controllers
But is there any way to directly access it? The way I mentioned above seems like a hack.