Ero sivun ”Widget:JwObsCharts” versioiden välillä
Järvi-meriwikistä
(21 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 192: | Rivi 192: | ||
if ( i18n[memo.obscode].type == 'num' ) { | if ( i18n[memo.obscode].type == 'num' ) { | ||
− | + | ||
− | + | headerCols.push( i18n[ 'Date' ][ memo.lang ] ); | |
− | + | headerCols.push( i18n[ 'Time' ][ memo.lang ] ); | |
headerCols.push( '"' + memo.axistitlev + '"' ); | headerCols.push( '"' + memo.axistitlev + '"' ); | ||
headerCols.push( 'Lisätiedot' ); | headerCols.push( 'Lisätiedot' ); | ||
Rivi 215: | Rivi 215: | ||
csvCols.push( '"' + memo.obses[o].value.toString().replace( '.', i18n['dec'][memo.lang] ) + '"' ); | csvCols.push( '"' + memo.obses[o].value.toString().replace( '.', i18n['dec'][memo.lang] ) + '"' ); | ||
− | csvCols.push( memo.obses[o].addInfo ); | + | csvCols.push( memo.obses[o].addInfo.replace( '<p>', '' ).replace( '</p>', '' ) ); |
csvCols.push( '' ); | csvCols.push( '' ); | ||
csvCols.push( memo.obses[o].maintainer ); | csvCols.push( memo.obses[o].maintainer ); | ||
Rivi 351: | Rivi 351: | ||
} | } | ||
+ | // if testsite | ||
+ | if ( memo.siteid == 170072 ) { so.test = true; } | ||
+ | |||
memo.jw.loadObses( so, function( o ) { | memo.jw.loadObses( so, function( o ) { | ||
− | memo.obses = memo.jw.obs; | + | memo.obses = memo.jw.obs; |
if ( memo.refcode != '-' ) { | if ( memo.refcode != '-' ) { | ||
memo.jwR.loadObses( { "obscode": memo.refcode, "siteid": memo.siteid, "sort": "SiteID", "custom": memo.reffilter }, function( r ) { | memo.jwR.loadObses( { "obscode": memo.refcode, "siteid": memo.siteid, "sort": "SiteID", "custom": memo.reffilter }, function( r ) { | ||
Rivi 360: | Rivi 363: | ||
} else { | } else { | ||
drawVisualization(memo); | drawVisualization(memo); | ||
− | } | + | } |
}); | }); | ||
} else { | } else { | ||
Rivi 1 083: | Rivi 1 086: | ||
// series for trend line | // series for trend line | ||
//memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['trend'], lineWidth: 2, opacity: 0.5, type: 'linear', visibleInLegend: memo.trendType!='moving' }; | //memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['trend'], lineWidth: 2, opacity: 0.5, type: 'linear', visibleInLegend: memo.trendType!='moving' }; | ||
− | + | ||
for (var o in memo.obsesA) { | for (var o in memo.obsesA) { | ||
dateStr = memo.obsesA[o].popup.match( /\([^)]*\)/g ); | dateStr = memo.obsesA[o].popup.match( /\([^)]*\)/g ); | ||
Rivi 1 315: | Rivi 1 318: | ||
// make week averages | // make week averages | ||
− | memo.avgW = {}; | + | memo.avgW = {}; |
for (var o in memo.obsesA) { | for (var o in memo.obsesA) { | ||
Rivi 1 364: | Rivi 1 367: | ||
memo.avgWlist = []; | memo.avgWlist = []; | ||
− | + | ||
for ( var y in memo.avgW ) { | for ( var y in memo.avgW ) { | ||
for ( var w in memo.avgW[y] ) { | for ( var w in memo.avgW[y] ) { | ||
Rivi 1 372: | Rivi 1 375: | ||
memo.avgWlist.sort( function(a, b) { return (a.y*100+a.w) - (b.y*100+b.w); }); | memo.avgWlist.sort( function(a, b) { return (a.y*100+a.w) - (b.y*100+b.w); }); | ||
− | |||
firstY = memo.avgWlist[0].y; | firstY = memo.avgWlist[0].y; | ||
firstW = memo.avgWlist[0].w; | firstW = memo.avgWlist[0].w; | ||
Rivi 1 799: | Rivi 1 801: | ||
'season': { 'winter': { 'fi': 'Talvi', 'en': 'Winter', 'sv': 'Vintern' } }, | 'season': { 'winter': { 'fi': 'Talvi', 'en': 'Winter', 'sv': 'Vintern' } }, | ||
'dec': { 'fi': ',', 'en': '.', 'sv': ',' }, | 'dec': { 'fi': ',', 'en': '.', 'sv': ',' }, | ||
− | 'sep': { 'fi': ' | + | 'sep': { 'fi': ';', 'en': ';', 'sv': ';' }, |
'obs': { | 'obs': { | ||
'type': 'num', | 'type': 'num', | ||
Rivi 1 972: | Rivi 1 974: | ||
'ValueUnit': { 'fi': 'Arvon tyyppi', 'en': 'Value type', 'sv': 'Värdes typ', 'ru': '???' }, | 'ValueUnit': { 'fi': 'Arvon tyyppi', 'en': 'Value type', 'sv': 'Värdes typ', 'ru': '???' }, | ||
'Date': { 'fi': 'Päivämäärä', 'en': 'Date', 'sv': 'Datum', 'ru': '???' }, | 'Date': { 'fi': 'Päivämäärä', 'en': 'Date', 'sv': 'Datum', 'ru': '???' }, | ||
+ | 'Time': { 'fi': 'Kellonaika', 'en': 'Time', 'sv': 'Tid', 'ru': '???' }, | ||
'Additionalinfo': { 'fi': 'Lisätiedot', 'en': 'Additional info', 'sv': 'Tillägsinformation', 'ru': '???' }, | 'Additionalinfo': { 'fi': 'Lisätiedot', 'en': 'Additional info', 'sv': 'Tillägsinformation', 'ru': '???' }, | ||
'Image': { 'fi': 'Valokuva', 'en': 'Image', 'sv': 'Bild', 'ru': '???' }, | 'Image': { 'fi': 'Valokuva', 'en': 'Image', 'sv': 'Bild', 'ru': '???' }, |