Ero sivun ”Widget:JwObsCharts” versioiden välillä
Järvi-meriwikistä
Rivi 728: | Rivi 728: | ||
tc++; | tc++; | ||
} | } | ||
− | + | ||
− | + | if ( tc > 0 ) { | |
− | + | tavg = Math.round( tsum/tc*10 ) / 10; | |
+ | tstr = tavg.toString().replace( '.', ',' ) + ' °C'; | ||
+ | } else { | ||
+ | tavg = -1; | ||
+ | tstr = 'Ei tuoreita havaintoja'; | ||
+ | } | ||
+ | |||
+ | var tsvg = '<?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">'; | ||
+ | tsvg += '<style type="text/css">.st0{fill:#0076B0;}.st1{fill:#D5DA26;}.st2{fill:none;stroke:#1E1E1E;stroke-width:2;stroke-miterlimit:10;}.st3{fill:#F7931E;}.st4{fill:none;stroke:#1E1E1E;stroke-width:3;stroke-miterlimit:10;}</style>'; | ||
+ | tsvg .= '<g>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="9" x2="69.5" y2="9"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="25.7" x2="69.5" y2="25.7"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="14.6" x2="66.2" y2="14.6"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="20.1" x2="66.2" y2="20.1"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="42.4" x2="69.5" y2="42.4"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="31.2" x2="66.2" y2="31.2"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="36.8" x2="66.2" y2="36.8"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="59" x2="69.5" y2="59"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="47.9" x2="66.2" y2="47.9"/>'; | ||
+ | tsvg .= '<line class="st2" x1="60.6" y1="53.5" x2="66.2" y2="53.5"/>'; | ||
+ | tsvg .= '</g>'; | ||
+ | tsvg .= '<path class="st3" d="M51.8,69.7V35.3c0-2.1-1.7-3.8-3.8-3.8c-2.1,0-3.8,1.7-3.8,3.8v34.4c-4.7,1.6-8.1,6-8.1,11.3'; | ||
+ | tsvg .= 'c0,6.6,5.3,11.9,11.9,11.9C54.6,92.9,60,87.5,60,81C60,75.7,56.6,71.2,51.8,69.7z"/>'; | ||
+ | tsvg .= '<path class="st4" d="M56.4,65.5V9.9c0-4.6-3.7-8.4-8.4-8.4h0c-4.6,0-8.4,3.7-8.4,8.4v55.7c-5.5,3-9.2,8.8-9.2,15.4'; | ||
+ | tsvg .= 'c0,9.7,7.9,17.5,17.5,17.5c9.7,0,17.5-7.9,17.5-17.5C65.6,74.3,61.9,68.5,56.4,65.5z"/>'; | ||
+ | tsvg .= '</svg>'; | ||
+ | |||
memo.widgetEl.html(''); | memo.widgetEl.html(''); | ||
memo.widgetEl.append( '<h3 style="text-align: center; font-size: 100%; margin-top: 0;">Pintaveden lämpötila</h3>' ); | memo.widgetEl.append( '<h3 style="text-align: center; font-size: 100%; margin-top: 0;">Pintaveden lämpötila</h3>' ); | ||
− | memo.widgetEl.append( '<div style="width: 120px; height: 120px; margin: 10px auto; padding: 10px; border-radius: 6px; Xborder: 3px solid rgba( 213, 218, 38, 0.5 );"> | + | memo.widgetEl.append( '<div style="width: 120px; height: 120px; margin: 10px auto; padding: 10px; border-radius: 6px; Xborder: 3px solid rgba( 213, 218, 38, 0.5 );">' + tsvg + '</div>'); |
− | + | memo.widgetEl.append( '<p style="text-align: center; line-height: 20px;" class="huomio">' + tstr + '</p>' ); | |
− | |||
− | |||
− | |||
− | |||
− | |||
} else if ( memo.obscode == 'alg' ) { | } else if ( memo.obscode == 'alg' ) { |