Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 27: | Rivi 27: | ||
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] ] = { sum: 0, count: 0, mean: 0, obses: [] }; } | if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { 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 41: | Rivi 41: | ||
if ( data ) { | if ( data ) { | ||
jw.obstype[ ot ].sum += data.val; | if ( typeof data.cat != 'undefined' ) { | ||
jw.obstype[ ot ].catsum += data.cat; | |||
jw.obstype[ ot ].catcount++; | |||
jw.obstype[ ot ].catmean = jw.obstype[ ot ].catsum / jw.obstype[ ot ].catcount; | |||
} | |||
jw.obstype[ ot ].sum += data.val; | |||
jw.obstype[ ot ].count++; | |||
jw.obstype[ ot ].mean = jw.obstype[ ot ].sum / jw.obstype[ ot ].count; | |||
} | } | ||


