Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 33: | Rivi 33: | ||
for ( var oi in jw.obsList ) { | for ( var oi in jw.obsList ) { | ||
var o = jw.obsList[oi]; | var o = jw.obsList[oi]; | ||
if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { newest: jw.obs[o].obsdatetime, sum: 0, count: 0, mean: -1, catsum: 0, catcount: 0, catmean: -1, obses: [] }; } | if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { newest: jw.obs[o].obsdatetime, sum: 0, count: 0, mean: -1, catsum: 0, catcount: 0, catmean: -1, obses: [] }; } | ||
jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | ||
| Rivi 88: | Rivi 87: | ||
if ( jw.obstype[ 'temp' ].count > 0 ) { | if ( jw.obstype[ 'temp' ].count > 0 ) { | ||
out += '<div class="col col-6 col-sm-4 col-md-2 text-center">'; | out += '<div class="col col-6 col-sm-4 col-md-2 text-center">'; | ||
out += '<div style="height: 30px; display: flex; justify-content: center; align-items: center; flex-direction: column;"><span class="h6" style="margin: 0;">' + jw.obstype[ 'temp' ].newest + '</span></div>'; | |||
out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; background-color: none; font-size: 44px; display: flex; justify-content: center; align-items: center; flex-direction: column;">+' + Math.round( jw.obstype[ 'temp' ].mean ) + '°</div>'; | out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; background-color: none; font-size: 44px; display: flex; justify-content: center; align-items: center; flex-direction: column;">+' + Math.round( jw.obstype[ 'temp' ].mean ) + '°</div>'; | ||
out += '<div style="height: 60px; display: flex; justify-content: center; align-items: center; flex-direction: column;"><span class="h6" style="margin: 0;">Pintaveden<br />lämpötila</span></div>'; | out += '<div style="height: 60px; display: flex; justify-content: center; align-items: center; flex-direction: column;"><span class="h6" style="margin: 0;">Pintaveden<br />lämpötila</span></div>'; | ||


