Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 577: | Rivi 577: | ||
var ivalmin = 999; | var ivalmin = 999; | ||
var ivalmax = 0; | var ivalmax = 0; | ||
+ | var ivalavg = -1; | ||
var icatsum = 0; | var icatsum = 0; | ||
Rivi 618: | Rivi 619: | ||
ivalavg = Math.round( ivalsum/ivalcount ); | ivalavg = Math.round( ivalsum/ivalcount ); | ||
− | |||
− | |||
if ( ivalmax > ivalmin ) { | if ( ivalmax > ivalmin ) { | ||
− | istr = ivalmin + ' | + | istr = ivalmin + '–' + ivalmax + ' cm'; |
} else { | } else { | ||
istr = ivalmin + ' cm'; | istr = ivalmin + ' cm'; | ||
Rivi 645: | Rivi 644: | ||
istr += '<br /><span>(' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | istr += '<br /><span>(' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | ||
} else { | } else { | ||
− | |||
− | |||
istr += '<br /><span class="smaller">('; | istr += '<br /><span class="smaller">('; | ||
istr += '<button style="margin-left: -1px; padding: 0; font-size: 13px; margin-bottom: 3px; color: #59B500;" type="button" class="btn Xbtn-secondary Xbtn-info" data-toggle="tooltip" data-placement="top" title="" data-original-title="Perustuu yhteensä ' + icount + ' havaintoon ajanjaksolla: ' + memo.obsesA[ memo.obsesA.length-1 ].obsdatetime.toLocaleDateString() + '-' + memo.obsesA[0].obsdatetime.toLocaleDateString() + '."><span class="fontawesome"></span></button>'; | istr += '<button style="margin-left: -1px; padding: 0; font-size: 13px; margin-bottom: 3px; color: #59B500;" type="button" class="btn Xbtn-secondary Xbtn-info" data-toggle="tooltip" data-placement="top" title="" data-original-title="Perustuu yhteensä ' + icount + ' havaintoon ajanjaksolla: ' + memo.obsesA[ memo.obsesA.length-1 ].obsdatetime.toLocaleDateString() + '-' + memo.obsesA[0].obsdatetime.toLocaleDateString() + '."><span class="fontawesome"></span></button>'; | ||
Rivi 671: | Rivi 668: | ||
y = row * 10 + 1; | y = row * 10 + 1; | ||
if ( icount > 0 ) { | if ( icount > 0 ) { | ||
− | + | if ( ivalavg > 0 ) { | |
− | + | if ( y < ivalavg/5 ) { | |
− | + | aclass = 'ice1'; | |
− | + | } else { | |
− | + | aclass = 'ice0'; | |
+ | } | ||
} else { | } else { | ||
− | aclass = 'ice0'; | + | dist = Math.sqrt( Math.pow( (4.5-col), 2 ) + Math.pow( (4.5-row), 2 ) )/ Math.sqrt( 40.5 ); |
+ | if ( today.getMonth() > 0 && today.getMonth() < 6 ) { dist = 1- dist; } | ||
+ | random = (Math.random()-0.5)*0.25; | ||
+ | if ( ( (dist+random) > (1-iavg) ) ) { | ||
+ | aclass = 'ice1'; | ||
+ | } else { | ||
+ | aclass = 'ice0'; | ||
+ | } | ||
} | } | ||
} else { | } else { |