Ero sivun ”Widget:Test4” versioiden välillä
Järvi-meriwikistä
Rivi 692: | Rivi 692: | ||
// make running average of 3 week averages | // make running average of 3 week averages | ||
for ( var w=1; w<(memo.avgWA.length-1); w++ ) { | for ( var w=1; w<(memo.avgWA.length-1); w++ ) { | ||
− | + | memo.avgWA[ w ].running3 = ( memo.avgWA[ w-1 ].sum + memo.avgWA[ w ].sum + memo.avgWA[ w+1 ].sum ) / ( memo.avgWA[ w-1 ].count + memo.avgWA[ w ].count + memo.avgWA[ w+1 ].count ); | |
− | memo.avgWA[ w ].running3 = ( memo.avgWA[ w-1 ].avg + memo.avgWA[ w ].avg + memo.avgWA[ w+1 ].avg ) / ( 3 ); | + | //memo.avgWA[ w ].running3 = ( memo.avgWA[ w-1 ].avg + memo.avgWA[ w ].avg + memo.avgWA[ w+1 ].avg ) / ( 3 ); |
} | } | ||
Rivi 699: | Rivi 699: | ||
for ( var w=2; w<(memo.avgWA.length-2); w++ ) { | for ( var w=2; w<(memo.avgWA.length-2); w++ ) { | ||
memo.avgWA[ w ].running = ( memo.avgWA[ w-2 ].sum + memo.avgWA[ w-1 ].sum + memo.avgWA[ w ].sum + memo.avgWA[ w+1 ].sum + memo.avgWA[ w+2 ].sum ) / ( memo.avgWA[ w-2 ].count + memo.avgWA[ w-1 ].count + memo.avgWA[ w ].count + memo.avgWA[ w+1 ].count + memo.avgWA[ w+2 ].count ); | memo.avgWA[ w ].running = ( memo.avgWA[ w-2 ].sum + memo.avgWA[ w-1 ].sum + memo.avgWA[ w ].sum + memo.avgWA[ w+1 ].sum + memo.avgWA[ w+2 ].sum ) / ( memo.avgWA[ w-2 ].count + memo.avgWA[ w-1 ].count + memo.avgWA[ w ].count + memo.avgWA[ w+1 ].count + memo.avgWA[ w+2 ].count ); | ||
− | memo.avgWA[ w ].running = ( memo.avgWA[ w-2 ].avg + memo.avgWA[ w-1 ].avg + memo.avgWA[ w ].avg + memo.avgWA[ w+1 ].avg + memo.avgWA[ w+2 ].avg ) / ( 5 ); | + | //memo.avgWA[ w ].running = ( memo.avgWA[ w-2 ].avg + memo.avgWA[ w-1 ].avg + memo.avgWA[ w ].avg + memo.avgWA[ w+1 ].avg + memo.avgWA[ w+2 ].avg ) / ( 5 ); |
} | } | ||