You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sum of the bar is shown wrong when there are negative values it the stack and last stack value is 0 (which is so it is not shown in bar on the image)
datalabels: {
formatter: (value, ctx) => {
const datasets = ctx.chart.data.datasets;
if (datasets.indexOf(ctx.dataset) === datasets.length - 1) {
let sum = 0;
datasets.map((dataset) => {
sum += dataset.data[ctx.dataIndex] as number;
});
return sum.toFixed(2);
} else {
return '';
}
},
anchor: 'end',
align: 'end',
},
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: