diff --git a/static/js/user_expenses.js b/static/js/user_expenses.js index ac5f760..a22cb1e 100644 --- a/static/js/user_expenses.js +++ b/static/js/user_expenses.js @@ -50,7 +50,7 @@ document.addEventListener("DOMContentLoaded", function () { } } }, - legend: { position: 'bottom' } + legend: { position: 'top' } }, scales: { x: { stacked: true }, @@ -74,6 +74,20 @@ document.addEventListener("DOMContentLoaded", function () { options: { responsive: true, scales: { y: { beginAtZero: true } } + plugins: { + tooltip: { + mode: 'index', + intersect: false, + callbacks: { + label: function (context) { + const value = context.raw; + if (!value) return null; + return `${context.dataset.label}: ${value}`; + } + } + }, + legend: { position: 'bottom' } + }, } }); }