Skip to content

Commit b03866c

Browse files
author
jacquesbach
committed
Changes
1 parent 4e7d797 commit b03866c

1 file changed

Lines changed: 40 additions & 15 deletions

File tree

static/js/script.js

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,27 +1050,52 @@ async function loadForecast() {
10501050
backgroundColor: 'rgba(239,68,68,0.18)',
10511051
},
10521052
{
1053-
label: 'Prognose',
1054-
data: values,
1055-
borderColor: '#ef4444',
1056-
backgroundColor: '#ef4444',
1057-
tension: 0.3,
1058-
pointRadius: (ctx) => {
1059-
return ctx.dataIndex === appState.activeIndex ? 8 : 6;
1060-
},
1061-
hitRadius: 20,
1062-
pointHoverRadius: (ctx) => {
1053+
label: 'Prognose',
1054+
data: values,
1055+
borderColor: '#ef4444',
1056+
backgroundColor: '#ef4444',
1057+
tension: 0.3,
1058+
1059+
// 🔴 STANDARD vs AKTIV
1060+
pointRadius: (ctx) => {
1061+
return ctx.dataIndex === appState.activeIndex ? 8 : 6;
1062+
},
1063+
1064+
pointBackgroundColor: (ctx) => {
1065+
return ctx.dataIndex === appState.activeIndex
1066+
? '#ffffff' // aktiv → weiß innen
1067+
: '#ef4444'; // normal → rot
1068+
},
1069+
1070+
pointBorderColor: '#ef4444',
1071+
1072+
pointBorderWidth: (ctx) => {
1073+
return ctx.dataIndex === appState.activeIndex ? 3 : 0;
1074+
},
1075+
1076+
hitRadius: 20,
1077+
1078+
// 🟡 HOVER LOGIK (WICHTIG!)
1079+
pointHoverRadius: (ctx) => {
10631080
return ctx.dataIndex === appState.activeIndex ? 8 : 10;
10641081
},
1082+
10651083
pointHoverBackgroundColor: (ctx) => {
1066-
return ctx.dataIndex === appState.activeIndex ? '#ffffff' : '#ffffff';
1084+
return ctx.dataIndex === appState.activeIndex
1085+
? '#ffffff' // aktiv → KEINE Änderung
1086+
: '#ef4444'; // normal → bleibt rot
10671087
},
1088+
1089+
pointHoverBorderColor: '#ef4444',
1090+
10681091
pointHoverBorderWidth: (ctx) => {
1069-
return ctx.dataIndex === appState.activeIndex ? 3 : 1;
1092+
return ctx.dataIndex === appState.activeIndex
1093+
? 3 // aktiv → KEINE Änderung
1094+
: 0; // normal → kein Rand beim Hover
10701095
},
1071-
pointBorderColor: '#ef4444',
1072-
fill: false
1073-
},
1096+
1097+
fill: false
1098+
},
10741099
]
10751100
},
10761101
options: {

0 commit comments

Comments
 (0)