Add spider web (radar) chart option to Category Analysis with per-model toggles

This commit is contained in:
overcuriousity
2026-01-17 23:31:40 +01:00
parent f02e48f4f9
commit e6292334cf

View File

@@ -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, { window.categoryChartInstance = new Chart(ctx, {
type: 'radar', type: 'radar',
data: { data: {
@@ -1196,8 +1204,8 @@
scales: { scales: {
r: { r: {
beginAtZero: !zoomedScale, beginAtZero: !zoomedScale,
min: zoomedScale ? Math.max(0, Math.min(...allData) - 0.5) : 0, min: zoomedScale ? minVal : 0,
max: zoomedScale ? Math.min(5, Math.max(...allData) + 0.5) : 5, max: zoomedScale ? maxVal : 5,
ticks: { ticks: {
stepSize: zoomedScale ? 0.5 : 1, stepSize: zoomedScale ? 0.5 : 1,
backdropColor: 'transparent' backdropColor: 'transparent'