Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 575: | Rivi 575: | ||
var ivalcount = 0; | var ivalcount = 0; | ||
var ivc = 0; | var ivc = 0; | ||
+ | var ivalmin = 999; | ||
+ | var ivalmax = 0; | ||
var icatsum = 0; | var icatsum = 0; | ||
Rivi 597: | Rivi 599: | ||
ivalsum += iw * obs.data.val; | ivalsum += iw * obs.data.val; | ||
ivalcount += iw; | ivalcount += iw; | ||
+ | ivalmin = Math.min( ivalmin, obs.data.val ); | ||
+ | ivalmax = Math.max( ivalmax, obs.data.val ); | ||
} | } | ||
Rivi 615: | Rivi 619: | ||
ivalavg = Math.round( ivalsum/ivalcount ); | ivalavg = Math.round( ivalsum/ivalcount ); | ||
console.log( ivalavg ); | console.log( ivalavg ); | ||
+ | console.log( ivalmin + '-' + ivalmax + ' cm' ); | ||
} | } |