Chart.js v2: space between doughnut inside doughnut

前端 未结 4 1487
眼角桃花
眼角桃花 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 20:50

    Another solution here : Padding Between Pie Charts in chart js

    const colors = ["#FF6384", "#36A2EB", "#FFCE56"];
    var pieChart = new Chart("myChart", {
         type: 'pie',
         data: {
               labels: ["Red", "Blue", "Yellow"],
              datasets: [{      
                       data: [8, 5, 6],
                       backgroundColor: colors,
         },{ 
         weight: 0.2
         },{ 
         data: [5, 7, 4],
         backgroundColor: colors,
         weight: 1.2
         }]
        }
      })
    
    

提交回复
热议问题