Chartjs-How to change bar width individually in chartjs?

0👍

Try this,

this.myChart = new Chart(ctx, {
    type: 'bar',
    data: {
        datasets: [{
            backgroundColor: [
            'rgba(0,128,0,0.2)',
            'rgba(0,0,0,0)'
            ],
        }]
    },
    options: {
        scales: {
            yAxes: [{
                barPercentage: 0.5,
                barThickness: 6,
                maxBarThickness: 8,
                minBarLength: 2
            }]
        }
    }
});

Leave a comment