Chart.js v2: space between doughnut inside doughnut

前端 未结 4 1486
眼角桃花
眼角桃花 2021-01-22 20:29

I am using chart.js v2.5.0. I put doughnut inside doughnut.

I want the disdance between 2 doughnuts(A) to be larger without affecting the distance betwe

4条回答
  •  抹茶落季
    2021-01-22 21:05

    To make it work with the latest ChartJS 2.7.2, I've just copied the source as suggested from https://github.com/chartjs/Chart.js/blob/master/src/controllers/controller.doughnut.js. Then I added the patch:

    if (me.index > 0) {
      me.outerRadius -= opts.datasetRadiusBuffer;
      me.innerRadius -= opts.datasetRadiusBuffer;
    }
    

    Everything was working as expected.

提交回复
热议问题