Chartjs-ChartJS BoxWidth not working

10👍

you should move the legend configuration inside the option object Fiddle

var myChart = new Chart(ctx, {
    type: 'doughnut',
    data: {
            labels: ['Completion'],
        datasets: [{
            data: [60, 20],
            backgroundColor: [
                'rgba(255, 99, 132, 0.8)',
                'rgba(54, 162, 235, 0)',
            ],

            borderWidth: 0
        }]
    },
    options: {
        responsive: false,
        cutoutPercentage: 90,
        events: [],
        legend: {
          labels: {
              boxWidth: 0
          }
      }
    }        
});

Leave a comment