Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 30: | Rivi 30: | ||
var data = {}; | var data = {}; | ||
var firstW = 3000; lastW = 0; | var firstW = 3000; lastW = 0; | ||
+ | var firstF = 500; var lastB = -500; | ||
+ | |||
var cnewyear = new Date( now.getFullYear()+1, 0, 1 ); | var cnewyear = new Date( now.getFullYear()+1, 0, 1 ); | ||
Rivi 48: | Rivi 50: | ||
firstW = Math.min( firstW, obs.winter ); lastW = Math.max( lastW, obs.winter ); | firstW = Math.min( firstW, obs.winter ); lastW = Math.max( lastW, obs.winter ); | ||
+ | firstF = Math.min( firstF, days ); lastB = Math.max( lastB, days ); | ||
if ( typeof data[ obs.winter ] == 'undefined' ) { data[ obs.winter ] = { 'winter': obs.winter }; } | if ( typeof data[ obs.winter ] == 'undefined' ) { data[ obs.winter ] = { 'winter': obs.winter }; } | ||
if ( obs.data.cat == 2 ) { | if ( obs.data.cat == 2 ) { | ||
− | data[ obs.winter ].freeze = days; | + | data[ obs.winter ].freeze = obs.comparedate; //days; |
} else if ( obs.data.cat == 5 ) { | } else if ( obs.data.cat == 5 ) { | ||
− | data[ obs.winter ].breakup = days; | + | data[ obs.winter ].breakup = obs.comparedate; //days; |
} | } | ||
Rivi 78: | Rivi 81: | ||
console.log(y); | console.log(y); | ||
if ( typeof data[y] != 'undefined' && typeof data[y].freeze != 'undefined' && typeof data[y].breakup != 'undefined' ) { | if ( typeof data[y] != 'undefined' && typeof data[y].freeze != 'undefined' && typeof data[y].breakup != 'undefined' ) { | ||
+ | //row = [ y, data[y].freeze, data[y].freeze, data[y].breakup, data[y].breakup ]; | ||
row = [ y, data[y].freeze, data[y].freeze, data[y].breakup, data[y].breakup ]; | row = [ y, data[y].freeze, data[y].freeze, data[y].breakup, data[y].breakup ]; | ||
} else { | } else { |