Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 526: | Rivi 526: | ||
// create addinfo | // create addinfo | ||
obs.addInfo = ""; | obs.addInfo = ""; | ||
if ( !!obs.media_url ) { | if ( !!obs.media_url ) { | ||
obs.img = new Image(); | obs.img = new Image(); | ||
obs.img.src = obs.media_url; | obs.img.src = obs.media_url; | ||
obs.addInfo = '<img style="object-fit: cover; width: 200px; height: 200px; margin: 5px 0 8px 0;" src="' + obs.media_url + '" />'; | obs.addInfo = '<img style="object-fit: cover; width: 200px; height: 200px; margin: 5px 0 8px 0;" src="' + obs.media_url + '" />'; | ||
} else { | |||
obs.media_url = ''; | |||
} | } | ||
if ( !!obs.printouts[ 'Lisätiedot' ][0] ) { | if ( !!obs.printouts[ 'Lisätiedot' ][0] ) { | ||
| Rivi 895: | Rivi 897: | ||
memo.obsesS[ obs.season ][ 'high' ] = obs.compareDate; | memo.obsesS[ obs.season ][ 'high' ] = obs.compareDate; | ||
} | } | ||
if ( memo.obsesS[ obs.season ][ 'maintainer' ] != obs.maintainer ) { memo.obsesS[ obs.season ][ 'maintainer' ] = ''; } | |||
if ( typeof memo.obsesS[ obs.season ][ 'low' ] != 'undefined' && typeof memo.obsesS[ obs.season ][ 'high' ] != 'undefined' ) { | |||
days = Math.round( ( memo.obsesS[ obs.season ][ 'high' ].getTime() - memo.obsesS[ obs.season ][ 'low' ].getTime() ) / ( 1000*60*60*24 ) ); | |||
if ( typeof memo.seriesO[ 'ice_cat_2,5' ] == 'undefined' ) { | |||
memo.seriesO[ 'ice_cat_2,5' ] = { 'id': 'ice_cat_2,5', 'order': 10, 'title': i18n[ 'ice_cat_2,5' ].title[ memo.lang ], 'type': 'candlestick', 'color': i18n[ 'ice_cat_2,5' ].color, obses: [] }; | |||
} | |||
memo.seriesO[ 'ice_cat_2,5' ].obses.push( { 'obsdatetime': obs.obsdatetime, 'season': obs.season, 'value': days, 'valueUnit': i18n[ 'days' ][ memo.lang ], 'addInfo': '', 'maintainer': memo.obsesS[ obs.season ][ 'maintainer' ], 'xvalue': obs.seasonmiddle, 'low': memo.obsesS[ obs.season ][ 'low' ], 'high': memo.obsesS[ obs.season ][ 'high' ], 'tooltip': '<p><b>' + i18n[ 'season' ][ 'winter' ][ memo.lang ] + ' ' + obs.season + '–' + (obs.season+1) + '</b></p><p>' + i18n[ 'ice_cat_2,5' ].title[ memo.lang ] + ': ' + days + ' ' + i18n[ 'days' ][ memo.lang ] + '</p>' } ); | |||
} | |||
} | |||
} | |||
// create ice cover series | |||
if ( memo.obscode == 'ice_cat_2,4,5' ) { | |||
memo.obsesS = {}; | |||
for ( var o in memo.obsesA ) { | |||
var obs = memo.obsesA[ o ]; | |||
if ( typeof memo.obsesS[ obs.season ] == 'undefined' ) { | |||
memo.obsesS[ obs.season ] = { 'maintainer': obs.maintainer }; | |||
} | |||
if ( obs.data.cat == '2' ) { | |||
memo.obsesS[ obs.season ][ 'low' ] = obs.compareDate; | |||
} else if ( obs.data.cat == '5' ) { | |||
memo.obsesS[ obs.season ][ 'high' ] = obs.compareDate; | |||
} | |||
if ( memo.obsesS[ obs.season ][ 'maintainer' ] != obs.maintainer ) { memo.obsesS[ obs.season ][ 'maintainer' ] = ''; } | if ( memo.obsesS[ obs.season ][ 'maintainer' ] != obs.maintainer ) { memo.obsesS[ obs.season ][ 'maintainer' ] = ''; } | ||
| Rivi 939: | Rivi 971: | ||
} | } | ||
} else if ( memo.seriesA[ s ].type == 'candlestick3' ) { | |||
memo.data.addColumn( 'date', memo.seriesA[ s ].title ); | |||
memo.data.addColumn( 'date', '' ); | |||
memo.data.addColumn( 'date', '' ); | |||
memo.data.addColumn( 'date', '' ); | |||
memo.data.addColumn({ role: 'tooltip', 'p': { 'html': true } }); | |||
memo.data.addColumn( 'date', '' ); | |||
memo.data.addColumn( { type: 'string', 'role': 'style' } ); | |||
memo.data.addColumn( { type: 'string', role: 'tooltip', 'p': { 'html': true } } ); | |||
memo.data.addColumn( { type: 'string', role: 'annotation' } ); | |||
memo.options.series.push( { type: 'candlesticks', color: memo.seriesA[ s ].color, strokeWidth: 2, stroke: '#cccccc' } ); | |||
memo.options.series.push( { type: 'scatter', color: memo.seriesA[ s ].color, strokeWidth: 2, stroke: '#cccccc' } ); | |||
} | |||
} | } | ||
| Rivi 2 061: | Rivi 2 110: | ||
}, | }, | ||
'ice_cat_2': { 'title': { 'fi': 'Jäätyminen', 'en': 'Freeze-up', 'sv': 'Förfrysning', 'ru': '???' }, 'title2': { 'fi': 'Pysyvä jääpeite', 'en': 'Permanent ice cover', 'sv': 'Permanent istäcke', 'ru': '???' }, color: colors[ 'winter' ] }, | 'ice_cat_2': { 'title': { 'fi': 'Jäätyminen', 'en': 'Freeze-up', 'sv': 'Förfrysning', 'ru': '???' }, 'title2': { 'fi': 'Pysyvä jääpeite', 'en': 'Permanent ice cover', 'sv': 'Permanent istäcke', 'ru': '???' }, color: colors[ 'winter' ] }, | ||
' | 'ice_cat_4': { 'title': { 'fi': 'Jäänlähtö', 'en': 'Ice break-up', 'sv': 'Islossning', 'ru': '???' }, 'title2': { 'fi': 'Jäätön kausi alkoi', 'en': 'Beginning of ice-free season', 'sv': 'Början av den isfria säsongen', 'ru': '???' }, color: '#006085' }, | ||
'ice_cat_5': { 'title': { 'fi': 'Jäänlähtö', 'en': 'Ice break-up', 'sv': 'Islossning', 'ru': '???' }, 'title2': { 'fi': 'Jäänlähtö', 'en': 'Ice break-up', 'sv': 'Islossning', 'ru': '???' }, color: '#006085' }, | |||
'ice_cat_2,5': { | 'ice_cat_2,5': { | ||
'type': 'date', | 'type': 'date', | ||
| Rivi 2 071: | Rivi 2 121: | ||
'unit': { 'fi': 'päivää', 'en': 'days', 'sv': 'dagar', 'ru': '' }, | 'unit': { 'fi': 'päivää', 'en': 'days', 'sv': 'dagar', 'ru': '' }, | ||
'axisTitleV': { 'fi': '', 'en': '', 'sv': '', 'ru': '' }, | 'axisTitleV': { 'fi': '', 'en': '', 'sv': '', 'ru': '' }, | ||
}, | }, | ||
'ice_cat_2,4,5': { | |||
'type': 'date', | |||
'season': 'winter', | |||
'direction': -1, | |||
'trend': { 'type': 'regression', 'layout': 'line' }, | |||
'title': { 'fi': 'Jääpeitekauden kesto', 'en': 'Duration of ice cover', 'sv': 'Längden på istäckesperioden', 'ru': '' }, | |||
'color': '#c1e7f7', | |||
'unit': { 'fi': 'päivää', 'en': 'days', 'sv': 'dagar', 'ru': '' }, | |||
'axisTitleV': { 'fi': '', 'en': '', 'sv': '', 'ru': '' } | |||
}, | |||
'snow': { | 'snow': { | ||
'catName': 'Lumitilanne', | 'catName': 'Lumitilanne', | ||


