Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 85: | Rivi 85: | ||
if ( typeof data.inreltomwl != 'undefined' ) { | if ( typeof data.inreltomwl != 'undefined' ) { | ||
jw.obstype[ot].mean = data.inreltomwl; | jw.obstype[ot].mean = data.inreltomwl; | ||
jw.obstype[ot].type = 'inreltomwl'; | jw.obstype[ot].type = 'inreltomwl'; | ||
} else if ( typeof data.inreltodateavg != 'undefined' ) { | } else if ( typeof data.inreltodateavg != 'undefined' ) { | ||
jw.obstype[ot].mean = data.inreltodateavg; | jw.obstype[ot].mean = data.inreltodateavg; | ||
| Rivi 92: | Rivi 92: | ||
jw.obstype[ot].mean = null; | jw.obstype[ot].mean = null; | ||
jw.obstype[ot].type = 'none'; | jw.obstype[ot].type = 'none'; | ||
} | |||
if ( jw.obstype[ot].type != 'none' ) { | |||
if ( jw.obstype[ot].type < -20 ) { | |||
jw.obstype[ot].cat = -2; | |||
} else if ( jw.obstype[ot].type < -10 ) { | |||
jw.obstype[ot].cat = -1; | |||
} else if ( jw.obstype[ot].type < 10 ) { | |||
jw.obstype[ot].cat = 0; | |||
} else if ( jw.obstype[ot].type < 20 ) { | |||
jw.obstype[ot].cat = 1; | |||
} else { | |||
jw.obstype[ot].cat = 2; | |||
} | |||
} | } | ||
} else { | } else { | ||
| Rivi 226: | Rivi 239: | ||
} else if ( ot == 'level' ) { | } else if ( ot == 'level' ) { | ||
var leveltxt = [ 'Vedenpinta erittäin matala', 'Vedenpinta matala', 'Vedenpinta normaali', 'Vedenpinta korkea', 'Vedenpinta erittäin korkea' ]; | |||
var levelcolor = [ '#308fb3', '#8db335', '#f1cb00', '#ce0000' ]; | |||
out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-direction: column; background-color: var( --syke-lightblue); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 80%); ">'; | out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-direction: column; background-color: var( --syke-lightblue); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 80%); ">'; | ||
| Rivi 234: | Rivi 248: | ||
out += '<div style="height: 60px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | out += '<div style="height: 60px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | ||
out += '<span class="h6" style="margin: 0;">' + | out += '<span class="h6" style="margin: 0;">' + levelcolor[ jw.obstype[ ot ].cat ] + '</span>'; | ||
out += '</div>'; | out += '</div>'; | ||


