Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 393: | Rivi 393: | ||
obs = memo.obsesA[ o ]; | obs = memo.obsesA[ o ]; | ||
s = obs.seriesId; | s = obs.seriesId; | ||
console.log( obs ); | |||
if ( typeof memo.seriesO[ s ] == 'undefined' ) { | if ( typeof memo.seriesO[ s ] == 'undefined' ) { | ||
memo.seriesO[ s ] = { 'id': s, 'order': 0, 'title': i18n[ s ].title[ memo.lang ], 'type': 'scatter', 'color': i18n[ s ].color, 'obses': [] }; | |||
memo.seriesO[ s ] = { 'id': s, 'title': i18n[ s ].title[ memo.lang ], 'type': 'scatter', 'color': i18n[ s ].color | |||
} | } | ||
obs.xvalue = obs.seasonmiddle; | obs.xvalue = obs.seasonmiddle; | ||
| Rivi 429: | Rivi 427: | ||
if ( typeof memo.obsesS[ obs.season ][ 'low' ] != 'undefined' && typeof memo.obsesS[ obs.season ][ 'high' ] != 'undefined' ) { | if ( typeof memo.obsesS[ obs.season ][ 'low' ] != 'undefined' && typeof memo.obsesS[ obs.season ][ 'high' ] != 'undefined' ) { | ||
if ( typeof memo.seriesO[ 'ice_cat_2,5' ] == 'undefined' ) { | if ( typeof memo.seriesO[ 'ice_cat_2,5' ] == 'undefined' ) { | ||
memo.seriesO[ 'ice_cat_2,5' ] = { 'id': 'ice_cat_2,5', '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' ] = { '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( { 'xvalue': obs.seasonmiddle, 'low': memo.obsesS[ obs.season ][ 'low' ], 'high': memo.obsesS[ obs.season ][ 'high' ], 'tooltip': '<p><b>Talvi ' + obs.season + '–' + (obs.season+1) + '</b></p><p>Jääpeitekausi: ' + Math.round( ( memo.obsesS[ obs.season ][ 'high' ].getTime() - memo.obsesS[ obs.season ][ 'low' ].getTime() ) / ( 1000*60*60*24 ) ) + ' päivää</p>' } ); | memo.seriesO[ 'ice_cat_2,5' ].obses.push( { 'xvalue': obs.seasonmiddle, 'low': memo.obsesS[ obs.season ][ 'low' ], 'high': memo.obsesS[ obs.season ][ 'high' ], 'tooltip': '<p><b>Talvi ' + obs.season + '–' + (obs.season+1) + '</b></p><p>Jääpeitekausi: ' + Math.round( ( memo.obsesS[ obs.season ][ 'high' ].getTime() - memo.obsesS[ obs.season ][ 'low' ].getTime() ) / ( 1000*60*60*24 ) ) + ' päivää</p>' } ); | ||
| Rivi 437: | Rivi 435: | ||
memo.seriesA = []; for ( var s in memo.seriesO ) { memo.seriesA.push( memo.seriesO[s] ) }; | memo.seriesA = []; for ( var s in memo.seriesO ) { memo.seriesA.push( memo.seriesO[s] ) }; | ||
memo.seriesA.sort( function( a, b ) { return a.order-b.order; } ); | |||
for ( var s in memo.seriesA ) { | for ( var s in memo.seriesA ) { | ||


