From 3cc572a45ba61766f05e9ac59315054c4ecda2f8 Mon Sep 17 00:00:00 2001 From: Miguel Astor Date: Wed, 25 Feb 2026 18:53:41 -0400 Subject: [PATCH] Add game source to tooltip in games chart Show service name (Steam, Local, Gog, etc.) below the bold game title when hovering over chart segments. Co-Authored-By: Claude Opus 4.5 --- generate_report.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/generate_report.py b/generate_report.py index cb63956..ee1fb86 100644 --- a/generate_report.py +++ b/generate_report.py @@ -742,11 +742,28 @@ HTML_TEMPLATE = """ } }, tooltip: { + titleFont: { + weight: 'bold' + }, + bodyFont: { + weight: 'normal' + }, callbacks: { + title: function(context) { + return context[0].label; + }, + beforeBody: function(context) { + const index = context[0].dataIndex; + const service = chartData[index].service; + if (service && service !== 'others') { + return service.charAt(0).toUpperCase() + service.slice(1); + } + return ''; + }, label: function(context) { const value = context.raw; const percent = ((value / totalPlaytime) * 100).toFixed(1); - return ' ' + formatTime(value) + ' (' + percent + '%)'; + return formatTime(value) + ' (' + percent + '%)'; } } }