Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 68: | Rivi 68: | ||
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(); | obsesReady( memo ); | ||
}); | }); | ||
function obsesReady( memo ) { | |||
// margin settings | |||
memo.margins = { top: 0, right: 25, bottom: 60, left: 60 }; | |||
if ( typeof i18n[ memo.obscode ].direction != 'undefined' ) { memo.vaxisdir = i18n[ memo.obscode ].direction; } else { memo.vaxisdir = 1; } | |||
// defaults for all charts | |||
memo.options = { | |||
title: "", //i18n[memo.obscode]['title'][memo.lang], | |||
//titleTextStyle: { fontSize: 14 }, | |||
backgroundColor: 'transparent', | |||
chartArea: { top: memo.margins.top, left: memo.margins.left, width: (memo.container.width() - memo.margins.left - memo.margins.right), height: (memo.container.height() - memo.margins.top - memo.margins.bottom), backgroundColor: { fill: '#daf0fa', stroke: '#fff', strokeWidth: 6 }}, | |||
legend: { position: 'bottom' }, | |||
crosshair: { trigger: 'both' }, | |||
tooltip: { isHtml: true }, | |||
seriesType: 'scatter', | |||
interpolateNulls: true, | |||
vAxis: { | |||
title: i18n[memo.obscode]['axisTitleV'][memo.lang], | |||
titleTextStyle: { bold: true }, | |||
slantedText: false, | |||
maxAlternation: 1, | |||
direction: memo.vaxisdir, | |||
gridlines: { color: '#fff' }, | |||
minorGridlines: { count: 0 }, | |||
viewWindow: { } | |||
}, | |||
hAxis: { | |||
title: '', | |||
slantedText: false, | |||
maxAlternation: 1, | |||
gridlines: { color: '#fff' }, | |||
minorGridlines: { count: 0 }, | |||
viewWindow: { } | |||
}, | |||
series: [ ], | |||
trendlines: [ ] | |||
}; | |||
memo.obsesTotal = 0; | |||
memo.obsMinValue = Infinity; | |||
memo.obsMaxValue = -Infinity; | |||
memo.obsMinDateMs = Infinity; | |||
memo.obsMaxDateMs = -Infinity; | |||
memo.obsMinCompDateMs = Infinity; | |||
memo.obsMaxCompDateMs = -Infinity; | |||
memo.season = i18n[memo.obscode]['season']; | |||
if ( memo.season == 'summer' || today.getMonth() > 7 ) { | |||
memo.curSeason = today.getFullYear(); | |||
} else { | |||
memo.curSeason = today.getFullYear()-1; | |||
} | |||
data = {}; | data = {}; | ||
| Rivi 427: | Rivi 483: | ||
} | } | ||
} | } | ||
| Rivi 582: | Rivi 637: | ||
</script> | </script> | ||
</includeonly> | |||


