From e6292334cf24150c09c9b202ccad082e2d41c51c Mon Sep 17 00:00:00 2001 From: overcuriousity Date: Sat, 17 Jan 2026 23:31:40 +0100 Subject: [PATCH] Add spider web (radar) chart option to Category Analysis with per-model toggles --- templates/dashboard.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/templates/dashboard.html b/templates/dashboard.html index 6b587b9..7bde8ab 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1167,6 +1167,14 @@ }); }); + // Handle empty data case + let minVal = 0; + let maxVal = 5; + if (allData.length > 0 && zoomedScale) { + minVal = Math.max(0, Math.min(...allData) - 0.5); + maxVal = Math.min(5, Math.max(...allData) + 0.5); + } + window.categoryChartInstance = new Chart(ctx, { type: 'radar', data: { @@ -1196,8 +1204,8 @@ scales: { r: { beginAtZero: !zoomedScale, - min: zoomedScale ? Math.max(0, Math.min(...allData) - 0.5) : 0, - max: zoomedScale ? Math.min(5, Math.max(...allData) + 0.5) : 5, + min: zoomedScale ? minVal : 0, + max: zoomedScale ? maxVal : 5, ticks: { stepSize: zoomedScale ? 0.5 : 1, backdropColor: 'transparent'