fix: #304. Compare page, shift digit of percentage value

This commit is contained in:
Cindy Chang
2024-06-19 13:36:16 +08:00
parent 69835ad05b
commit 50c98892c4

View File

@@ -503,10 +503,7 @@ export default {
},
label: function(context) {
let value = context.parsed.y;
value = context.parsed.y === 0 ? 0 :
context.parsed.y === null ? "n/a" :
context.parsed.y.toFixed(2);
value = `${(context.parsed.y * 10).toFixed(2)}%`;
switch (context.datasetIndex) {
case 0: // Primary
return `${labelPrimary}: ${value}`;