Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| (6 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
| Rivi 72: | Rivi 72: | ||
//use just the most recent from level obses | //use just the most recent from level obses | ||
if ( ot == 'level' ) { jw.wbody[ wb ][ ot ].obses.splice(1); } | if ( ot == 'level' ) { jw.wbody[ wb ][ ot ].obses.splice(1); } | ||
for ( var oi in jw.wbody[ wb ][ ot ].obses ) { | for ( var oi in jw.wbody[ wb ][ ot ].obses ) { | ||
| Rivi 109: | Rivi 109: | ||
if ( ot == 'level' ) { | if ( ot == 'level' ) { | ||
if ( typeof data.inreltodateavg != 'undefined' ) { | if ( typeof data.inreltodateavg != 'undefined' ) { | ||
jw.wbody[ wb ][ot].mean = data.inreltodateavg; | jw.wbody[ wb ][ot].mean = data.inreltodateavg; | ||
| Rivi 162: | Rivi 161: | ||
ot = jw.obsorder[ i ].obstype; | ot = jw.obsorder[ i ].obstype; | ||
if ( ot != 'level' || jw.wbody[ wb ][ ot ].type != 'absolute' ) { | if ( ot != 'level' || ( jw.wbody[ wb ][ ot ].type != 'absolute' && jw.wbody[ wb ][ ot ].mean !== null ) ) { | ||
out += '<div class="col col-6 col-sm-4 col-md-3 text-center">'; | out += '<div class="col col-6 col-sm-4 col-md-3 text-center">'; | ||
| Rivi 273: | Rivi 272: | ||
out += '</div>'; | out += '</div>'; | ||
} else if ( ot == 'level' ) { | } else if ( ot == 'level' && jw.wbody[ wb ][ ot ].mean !== null ) { | ||
var leveltxt = { 'inreltomwl': 'Keskiveden-<br />korkeudesta', 'inreltodateavg': 'Ajankohdan<br />keskim.<br />vedenkorkeudesta' }; | var leveltxt = { 'inreltomwl': 'Keskiveden-<br />korkeudesta', 'inreltodateavg': 'Ajankohdan<br />keskim.<br />vedenkorkeudesta' }; | ||
| Rivi 279: | Rivi 278: | ||
out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-direction: column; Xbackground-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; Xbackground-color: var( --syke-lightblue); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 80%); ">'; | ||
out += '<div style="font-size: 36px;">' + jw.wbody[ wb ][ ot ].mean.toLocaleString( 'fi-FI', { signDisplay: 'always' } ) + '</div>'; | out += '<div style="font-size: 36px;">' + jw.wbody[ wb ][ ot ].mean.toLocaleString( 'fi-FI', { signDisplay: 'always' } ) + '</div>'; | ||
out += '<div style="font-size: 24px; margin-top: -20px;">cm</div>'; | out += '<div style="font-size: 24px; margin-top: -20px;">cm</div>'; | ||


