Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 42: | Rivi 42: | ||
if ( typeof data.cat != 'undefined' ) { | if ( typeof data.cat != 'undefined' ) { | ||
jw.obstype[ ot ].catsum += parseInt( data.cat ); | |||
if ( ot == 'ice' ) { | |||
if ( data.cat == '0' || data.cat == '5' ) { | |||
jw.obstype[ ot ].catsum += 0; | |||
} else if ( data.cat == '1' || data.cat == '4' ) { | |||
jw.obstype[ ot ].catsum += 1; | |||
} else { // 2 or 3 | |||
jw.obstype[ ot ].catsum += 2; | |||
} | |||
jw.obstype[ ot ].catcount++; | |||
jw.obstype[ ot ].catmean = jw.obstype[ ot ].catsum / jw.obstype[ ot ].catcount; | |||
} else { | |||
jw.obstype[ ot ].catsum += parseInt( data.cat ); | |||
jw.obstype[ ot ].catcount++; | |||
jw.obstype[ ot ].catmean = jw.obstype[ ot ].catsum / jw.obstype[ ot ].catcount; | |||
} | |||
} | } | ||
| Rivi 86: | Rivi 104: | ||
if ( typeof jw.obstype[ 'ice' ] != 'undefined' ) { | if ( typeof jw.obstype[ 'ice' ] != 'undefined' ) { | ||
if ( jw.obstype[ 'ice' ].count > 0 || jw.obstype[ 'ice' ].catcount > 0 ) { | if ( jw.obstype[ 'ice' ].count > 0 || jw.obstype[ 'ice' ].catcount > 0 ) { | ||
icetxt = [ 'Ei jäätä', ' | icecatmean = ParseInt( jw.obstype[ 'ice' ].catmean ); | ||
icetxt = [ 'Ei jäätä', 'Osittain jäässä', 'Yhtenäinen jääpeite' ]; | |||
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">'; | ||
out += '<div style="width: 120px; height: 120px; margin: auto; border-radius: 50%; background-color: #fff;">'; | out += '<div style="width: 120px; height: 120px; margin: auto; border-radius: 50%; background-color: #fff;">'; | ||


