Round the percentage displayed in the tooltip to a whole number

This commit is contained in:
Paul Gauthier (aider) 2024-07-29 11:31:35 -03:00
parent 0e6ebfb8a0
commit 1db6962285

View file

@ -51,7 +51,7 @@ document.addEventListener('DOMContentLoaded', function () {
tooltip: {
callbacks: {
label: function(context) {
return `${context.raw.label}: ${context.raw.y.toFixed(2)}%`;
return `${context.raw.label}: ${Math.round(context.raw.y)}%`;
}
}
}