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, {
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'