Ero sivun ”Widget:JwObsCharts2” versioiden välillä
Järvi-meriwikistä
Rivi 330: | Rivi 330: | ||
memo.jw = new jwApi(); | memo.jw = new jwApi(); | ||
− | memo.jwR = new jwApi(); | + | //memo.jwR = new jwApi(); |
− | var custom | + | var so = { 'startdate': memo.startDate, 'custom': '' }; |
+ | |||
if ( typeof memo.obscodeParts[1] != 'undefined' ) { | if ( typeof memo.obscodeParts[1] != 'undefined' ) { | ||
if ( typeof memo.obscodeParts[2] != 'undefined' ) { | if ( typeof memo.obscodeParts[2] != 'undefined' ) { | ||
− | custom += '[[' + i18n[memo.obscodeParts[0]].catName + '::' + memo.obscodeParts[2].split(',').join('||') +']]'; | + | so.custom += '[[' + i18n[memo.obscodeParts[0]].catName + '::' + memo.obscodeParts[2].split(',').join('||') +']]'; |
} else { | } else { | ||
− | custom += '[[' + i18n[memo.obscode].catName + '::>0]]'; | + | so.custom += '[[' + i18n[memo.obscode].catName + '::>0]]'; |
} | } | ||
} | } | ||
+ | |||
+ | if ( memo.refcode == '-' ) { | ||
+ | so.obscode = memo.obscodeParts[0]; | ||
+ | } else { | ||
+ | s.custom += '[[ObsCode::' + memo.obscodeParts[0] + ' || ' + memo.refcode + ']]'; | ||
+ | } | ||
+ | |||
if ( memo.siteid != '-' ) { | if ( memo.siteid != '-' ) { | ||
− | so | + | so.siteid = memo.siteid; |
} else { | } else { | ||
− | so | + | so.waterbody = memo.waterbody; |
} | } | ||
memo.jw.loadObses( so, function( o ) { | memo.jw.loadObses( so, function( o ) { | ||
memo.obses = memo.jw.obs; | memo.obses = memo.jw.obs; | ||
− | + | console.log( memo.obses ); | |
− | + | drawVisualization(memo); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}); | }); | ||
} else { | } else { | ||
Rivi 1 087: | Rivi 1 089: | ||
// 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' }; | ||
− | console.log( memo.obsesA ); | + | console.log( memo.obsesA ); |
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 ); |