Chartjs-Chart js padding isn't working for data labels

0👍

I figured it out. You need to use align: ‘top’

plugins: {
    legend: {
        labels: {
            font: {
                size: 20
            }
        }
    },
    datalabels: {
        color: '#000',
        anchor: 'end',
        align: 'top',
        formatter: function(value, context) { /* sets custom labels */
            return context.chart.data.value_labels[context.dataIndex];
        }
    }
},

Leave a comment