Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 163: | Rivi 163: | ||
} | } | ||
+ | |||
+ | memo.obsMinDate = new Date( memo.obsMinDateMs ); | ||
+ | memo.obsMaxDate = new Date( memo.obsMaxDateMs ); | ||
+ | memo.obsMinYear = memo.obsMinDate.getFullYear(); | ||
+ | memo.obsMaxYear = memo.obsMaxDate.getFullYear(); | ||
+ | memo.obsMinCompDate = new Date( memo.obsMinCompDateMs ); | ||
+ | memo.obsMaxCompDate = new Date( memo.obsMaxCompDateMs ); | ||
+ | |||
+ | memo.obsesA = []; memo.dataA = []; | ||
− | + | for (var o in memo.jw.obs) { | |
− | + | ||
− | + | obs = memo.jw.obs[o]; | |
− | + | ||
+ | // style points | ||
+ | if ( obs.seriesId == memo.curSeason ) { | ||
+ | baseSize = 6; | ||
+ | } else if (memo.obsesTotal < 100) { | ||
+ | baseSize = 4; | ||
+ | } else if (memo.obsesTotal < 200) { | ||
+ | baseSize = 3; | ||
+ | } else if (memo.obsesTotal < 300) { | ||
+ | baseSize = 2; | ||
+ | } else { | ||
+ | baseSize = 2; | ||
+ | } | ||
+ | |||
+ | //if ( memo.graphType == 'dateofyear' ) { baseSize = baseSize + 1; } | ||
+ | |||
+ | if (!!obs.addInfo) { | ||
+ | //obs.style = 'point { shape-type: star; size: ' + (baseSize+3) + '; shape-dent: 0.5; fill-color: ' + colors['noticeObses'] + '; stroke-width: 0; stroke-color: ' + maintColors[memo.obses[o].maintainer] + '; }'; | ||
+ | //obs.style = 'point { size: ' + (baseSize+1) + '; stroke-width: 2; stroke-color: gold; }'; | ||
+ | obs.style = 'point { size: ' + (baseSize+1) + '; stroke-width: 3; stroke-color: ' + maintColors[obs.maintainer] + '; }'; | ||
+ | } else { | ||
+ | obs.style = 'point { size: ' + baseSize + '; stroke-width: 0.5; stroke-color: ' + maintColors[obs.maintainer] + '; }'; | ||
+ | } | ||
+ | |||
+ | memo.obsesA.push( obs ); | ||
+ | |||
+ | } | ||
+ | |||
+ | // sort | ||
+ | memo.obsesA.sort( function(a, b) { return a.obsdatetime - b.obsdatetime; }); | ||