From 44a0030c46347f0ff45375ab548023c909c5d11f Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Thu, 5 Mar 2026 17:32:14 +0200 Subject: [PATCH] Show monthly total in project chart tooltip When hovering over a bar in the Cost by Project chart, the tooltip now shows the total for that month across all projects at the bottom. Co-Authored-By: Claude Opus 4.6 --- core/templates/core/payroll_dashboard.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/templates/core/payroll_dashboard.html b/core/templates/core/payroll_dashboard.html index 3e36a0b..99b6aa3 100644 --- a/core/templates/core/payroll_dashboard.html +++ b/core/templates/core/payroll_dashboard.html @@ -814,6 +814,14 @@ document.addEventListener('DOMContentLoaded', function() { callbacks: { label: function(context) { return context.dataset.label + ': ' + fmt(context.parsed.y); + }, + // Show the month total at the bottom of the tooltip + footer: function(tooltipItems) { + var total = 0; + tooltipItems[0].chart.data.datasets.forEach(function(ds) { + total += ds.data[tooltipItems[0].dataIndex] || 0; + }); + return 'Total: ' + fmt(total); } } }