Ero sivun ”Widget:JwObsCharts” versioiden välillä
Järvi-meriwikistä
Rivi 796: | Rivi 796: | ||
for (var o in memo.obsesA) { | for (var o in memo.obsesA) { | ||
− | obs = memo.obsesA[ o ]; | + | obs = memo.obsesA[ o ]; |
+ | |||
s = obs.seriesId; | s = obs.seriesId; | ||
+ | |||
+ | if ( s != today.getFullYear() ) { | ||
+ | s = memo.axisMinDate.getFullYear() + memo.axisMaxDate.getFullYear(); | ||
+ | } | ||
if (typeof memo.seriesO[ s ] == 'undefined' ) { | if (typeof memo.seriesO[ s ] == 'undefined' ) { | ||
if ( s == today.getFullYear() ) { | if ( s == today.getFullYear() ) { | ||
− | memo.seriesO[ s ] = { 'id': s, 'order': s, 'title': s, 'type': 'scatter', 'color': '#9999ff', 'trendline': 'none', 'obses': [] }; | + | memo.seriesO[ s ] = { 'id': s, 'order': s, 'title': s, 'type': 'scatter', 'color': '#9999ff', linewidth: 3, 'visibleinlegend': true, 'trendline': 'none', 'obses': [] }; |
} else { | } else { | ||
− | memo.seriesO[ s ] = { 'id': s, 'order': s, 'title': s, 'type': 'scatter', 'color': '#ff9999', 'trendline': 'none', 'obses': [] }; | + | memo.seriesO[ s ] = { 'id': s, 'order': s, 'title': s, 'type': 'scatter', 'color': '#ff9999', 'visibleinlegend': false, 'trendline': 'none', 'obses': [] }; |
} | } | ||
} | } | ||
+ | |||
obs.xvalue = obs.compareDate; | obs.xvalue = obs.compareDate; | ||
obs.yvalue = obs.data.val; | obs.yvalue = obs.data.val; | ||
Rivi 827: | Rivi 833: | ||
memo.data.addColumn( { type: 'string', role: 'annotation' } ); | memo.data.addColumn( { type: 'string', role: 'annotation' } ); | ||
− | memo.options.series.push( { type: 'scatter', pointType: 'circle', pointSize: 9, color: memo.seriesA[ s ].color } ); | + | memo.options.series.push( { type: 'scatter', pointType: 'circle', pointSize: 9, color: memo.seriesA[ s ].color, visibleInLegend: memo.seriesA[ s ].visibleinlegend } ); |
if ( memo.seriesA[ s ].trendline != 'none' && memo.seriesA[ s ].obses.length > 1 ) { | if ( memo.seriesA[ s ].trendline != 'none' && memo.seriesA[ s ].obses.length > 1 ) { |