Chartjs-How to write labels along with data on top and bottom of each stack in bar chart

1👍

give both datasets a different align like this:

datasets: [
    {
        type: 'bar',
        data: company,
        backgroundColor: '#2FC798',
        borderColor: '#2FC798',
        borderWidth: 2.2,
        lineTension: 0.4,
        pointStyle: 'rectRot',
        datalabels: {
            align: 'start',
        }
    },
    {
        type: 'bar',
        data: sector,
        backgroundColor: '#C72151',
        borderColor: '#C72151',
        borderWidth: 2.2,
        lineTension: 0.4,
        pointStyle: 'rectRot',
        datalabels: {
            align: 'end',
        }
    },
],

Here is a JSFiddle

Leave a comment