Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 597: | Rivi 597: | ||
istr += '<br /><span class="smaller">(n=' + tc.toString() + ', viimeisin ' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | istr += '<br /><span class="smaller">(n=' + tc.toString() + ', viimeisin ' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} else { | } else { | ||
iavg = -1; | iavg = -1; | ||
istr = 'Ei tuoreita<br />havaintoja'; | istr = 'Ei tuoreita<br />havaintoja'; | ||
− | |||
− | |||
} | } | ||
+ | |||
+ | var isvg = '<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">'; | ||
+ | isvg += '<style type="text/css">.ice0{fill:#0076B0;} .ice1{fill:#D5DA26;} .icex{fill:#ccc;}</style>'; | ||
+ | |||
+ | var rx = 10; | ||
+ | var ry = 10; | ||
+ | |||
+ | for ( var row=0; row<10; row++ ) { | ||
+ | for ( var col=0; col<10; col++ ) { | ||
+ | x = col * 10 + 1; | ||
+ | y = row * 10 + 1; | ||
+ | if ( ic > 0 ) { | ||
+ | if ( Math.random() < ( (iavg) / 3) ) { | ||
+ | aclass = 'ice1'; | ||
+ | } else { | ||
+ | aclass = 'ice0'; | ||
+ | } | ||
+ | } else { | ||
+ | aclass = 'icex'; | ||
+ | } | ||
+ | isvg += '<rect x="' + x.toString() +'" y="' + y.toString() +'" class="' + aclass + '" width="8" height="8"/>'; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | isvg += '</svg>'; | ||
− | |||
− | |||
− | |||
memo.widgetEl.html(''); | memo.widgetEl.html(''); | ||
memo.widgetEl.append( '<h3 style="text-align: center; font-size: 18px; margin-top: 0;">Jäätilanne' + addToTitle + '</h3>' ); | memo.widgetEl.append( '<h3 style="text-align: center; font-size: 18px; margin-top: 0;">Jäätilanne' + addToTitle + '</h3>' ); |