Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 1 497: | Rivi 1 497: | ||
memo.fullscreenEl.fadeIn( "slow" ); | memo.fullscreenEl.fadeIn( "slow" ); | ||
if ( memo.download) { memo.downloadEl.fadeIn( "slow" ); } | if ( memo.download) { memo.downloadEl.fadeIn( "slow" ); } | ||
if ( memo.showlink ) { memo.sitelinkEl.fadeIn( "slow" ); } | if ( memo.showlink ) { memo.sitelinkEl.fadeIn( "slow" ); } | ||
memo.selectedCol = 0; | memo.selectedCol = 0; | ||
google.visualization.events.addListener( memo.chart, 'select', function () { | google.visualization.events.addListener( memo.chart, 'select', function () { | ||
console.log( 'select' ); | |||
var selection = memo.chart.getSelection(); | var selection = memo.chart.getSelection(); | ||
| Rivi 1 571: | Rivi 1 547: | ||
}); | }); | ||
google.visualization.events.addListener( memo.chart, 'ready', function () { | |||
console.log( 'ready' ); | |||
// hide every second vaxis gridline on cat charts | |||
if ( i18n[memo.obscode]['type'] == 'cat') { | |||
var glc = 0; | |||
jQuery( document.getElementById(memo.id) ).find( 'rect[height="1"]' ).each( function() { | |||
if ( ( glc++ % 2 ) == 0 ) { | |||
jQuery( this ).attr( 'fill', 'none' ); | |||
} | |||
}); | |||
} | |||
// add dash to trendlines | |||
jQuery( document.getElementById(memo.id) ).find( 'path[stroke-width="2.33"]' ).each( function() { | |||
jQuery( this ).attr('stroke-dasharray', '5, 5'); | |||
}); | |||
// move current observations to top | |||
gEl = jQuery( document.getElementById(memo.id) ).find( 'svg' ).append( 'g' ); | |||
jQuery( document.getElementById(memo.id) ).find( 'path[stroke="#3366cc"]' ).detach().appendTo( gEl ); | |||
jQuery( document.getElementById(memo.id) ).find( 'circle[fill="#3366cc"]' ).detach().appendTo( gEl ); | |||
jQuery( document.getElementById(memo.id) ).find( 'circle[stroke-width="3"]' ).each( function() { jQuery( this ).parent().append( jQuery( this ) ); }); | |||
}); | |||


