Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 33: | Rivi 33: | ||
memo.obscode = "ice"; | memo.obscode = "ice"; | ||
memo.siteid = memo.widgetEl.attr( 'data-jw-siteid' ); //'284245'; //'240829'; //'284245'; | memo.siteid = memo.widgetEl.attr( 'data-jw-siteid' ); //'284245'; //'240829'; //'284245'; | ||
+ | |||
+ | memo.season = i18n[memo.obscode]['season']; | ||
+ | if ( memo.season == 'summer' || today.getMonth() > 7 ) { | ||
+ | memo.curSeason = today.getFullYear(); | ||
+ | } else { | ||
+ | memo.curSeason = today.getFullYear()-1; | ||
+ | } | ||
// add chart container | // add chart container | ||
Rivi 60: | Rivi 67: | ||
memo.jw.loadObses( { 'obscode': memo.obscode, 'siteid': memo.siteid, 'custom': '[[Jäätilanne::2||5]]' }, function( o ) { | memo.jw.loadObses( { 'obscode': memo.obscode, 'siteid': memo.siteid, 'custom': '[[Jäätilanne::2||5]]' }, function( o ) { | ||
+ | |||
+ | obsesReady(); | ||
+ | |||
+ | }); | ||
+ | |||
+ | function obsesReady() { | ||
data = {}; | data = {}; | ||
var firstW = 3000; lastW = 0; | var firstW = 3000; lastW = 0; | ||
var firstF = 500; var lastB = -500; | var firstF = 500; var lastB = -500; | ||
+ | //var firstCd = new Date( now.getFullyear(), 11, 31 ); var lastCd = new Date(); | ||
var cnewyear = new Date( now.getFullYear()+1, 0, 1 ); | var cnewyear = new Date( now.getFullYear()+1, 0, 1 ); | ||
Rivi 143: | Rivi 157: | ||
row = [ y, null, null, null, null, null, null, null, null, null ]; | row = [ y, null, null, null, null, null, null, null, null, null ]; | ||
} | } | ||
− | |||
− | |||
table.push( row ); | table.push( row ); | ||
Rivi 188: | Rivi 200: | ||
doResize(); | doResize(); | ||
− | } | + | } |
− | |||
memo.fullscreenEl.on( 'click', function() { | memo.fullscreenEl.on( 'click', function() { |