Spaces:
Running
Running
AJAY KASU commited on
Commit ·
f3be808
1
Parent(s): 1c88b02
Fix: Chart tooltip now shows percentage (e.g. 12.6%) instead of decimal (0.126)
Browse files- api/static/index.html +10 -1
api/static/index.html
CHANGED
|
@@ -593,7 +593,16 @@
|
|
| 593 |
options: {
|
| 594 |
responsive: true,
|
| 595 |
plugins: {
|
| 596 |
-
legend: { position: 'right', labels: { color: '#94a3b8' } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 597 |
}
|
| 598 |
}
|
| 599 |
});
|
|
|
|
| 593 |
options: {
|
| 594 |
responsive: true,
|
| 595 |
plugins: {
|
| 596 |
+
legend: { position: 'right', labels: { color: '#94a3b8' } },
|
| 597 |
+
tooltip: {
|
| 598 |
+
callbacks: {
|
| 599 |
+
label: function(context) {
|
| 600 |
+
const label = context.label || '';
|
| 601 |
+
const value = (context.parsed * 100).toFixed(2);
|
| 602 |
+
return `${label}: ${value}%`;
|
| 603 |
+
}
|
| 604 |
+
}
|
| 605 |
+
}
|
| 606 |
}
|
| 607 |
}
|
| 608 |
});
|