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];
}
}
},
- Chartjs-Want to save chart.js charts to image using django cron job
- Chartjs-How to draw Line chart using chart.js and datalabels should be shown
Source:stackexchange.com