0👍
The background is transparent. I think you can’t really color the midle circle..
The main option is to put a background color on canvas or chart but all the white spaces will be colored.
- Chartjs-Overwrite Default ChartJS Variables with Webpack
- Chartjs-How to add legend on chart js annotation
0👍
its transparent , takes background colour
- Chartjs-How can i get the Chart JS Bar Graph Bar Label and Value on click?
- Chartjs-Chartjs maintain points position, put image alongside with label
0👍
Use chart.js 3.8
const colorcenter = {
id: 'colorcenter',
beforeDraw(chart, args, options) {
const {ctx, chartArea: {top, right, bottom, left, width, height}} = chart;
const radius = chart._metasets[0].controller.innerRadius;
const x = chart.getDatasetMeta(0).data[0].x;
const y = chart.getDatasetMeta(0).data[0].y
ctx.arc(x, y, radius, 0, 2 * Math.PI);
ctx.fillStyle = options.backgroundColor;
ctx.fill();
}
}
Source:stackexchange.com