Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| (16 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
| Rivi 135: | Rivi 135: | ||
memo.widgetEl.css( 'position', 'relative' ); | memo.widgetEl.css( 'position', 'relative' ); | ||
memo.widgetEl.css( 'margin-bottom', '0.5em' ); | //memo.widgetEl.css( 'margin-bottom', '0.5em' ); | ||
// add loader animation | // add loader animation | ||
| Rivi 145: | Rivi 145: | ||
// add chart container | // add chart container | ||
memo.widgetEl.append( '<div class="card JwCard | memo.widgetEl.append( '<div class="card JwCard Xmb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header" style="min-height: 49px;"></div><div class="card-body p-2" style="position: relative; width: 100%; height: 100%;"><div class="chart-container" style="position: relative; z-index: 110; width: 100%; height: 100%;"></div></div><div class="card-footer"></div>' ); | ||
memo.chartEl = jQuery( this ).find( '.chart-container' ); | memo.chartEl = jQuery( this ).find( '.chart-container' ); | ||
memo.chartEl.css( 'height', memo.height + 'px' ); | memo.chartEl.css( 'height', memo.height + 'px' ); | ||
| Rivi 724: | Rivi 724: | ||
memo.options.vAxis.viewWindow.min = 0; | memo.options.vAxis.viewWindow.min = 0; | ||
} else { | } else { | ||
memo.options.vAxis.viewWindow.min = memo.obsMinValue; | // memo.options.vAxis.viewWindow.min = memo.obsMinValue; | ||
} | } | ||
} else { | } else { | ||
| Rivi 1 002: | Rivi 1 002: | ||
function addDataToSeasonWithRefsChart(memo) { | function addDataToSeasonWithRefsChart(memo) { | ||
console.log( memo ); | |||
// do axis min and max | // do axis min and max | ||
memo.axisMinDate = new Date( memo.curSeason, 0, 1 ); | memo.axisMinDate = new Date( memo.curSeason, 0, 1 ); | ||
| Rivi 1 678: | Rivi 1 678: | ||
memo.options.hAxis.ticks.push({v: middleOfMonth, f: i18n.months[m]['roman'] }); | memo.options.hAxis.ticks.push({v: middleOfMonth, f: i18n.months[m]['roman'] }); | ||
} | } | ||
} | |||
if ( memo.obscode == 'level' ) { | |||
memo.options.vAxis.viewWindow.min = Math.floor( memo.obsMinValue * 10 ) / 10; | |||
memo.options.vAxis.viewWindow.max = Math.ceil( memo.obsMaxValue * 10 ) / 10 ; | |||
} | } | ||
//console.log( memo ); | |||
drawChart( memo ); | drawChart( memo ); | ||
| Rivi 1 784: | Rivi 1 791: | ||
} | } | ||
var doResize = function( memo, force = false ) { | var doResize = function( memo, force = false ) { | ||
console.log( 'reize'); | |||
function wait() { | function wait() { | ||
| Rivi 1 863: | Rivi 1 872: | ||
//wait(); | //wait(); | ||
if ( typeof memo.chartEl != 'undefined' ) { | if ( typeof memo.chartEl != 'undefined' ) { | ||
setTimeout( wait, | setTimeout( wait, 100 ); | ||
} | } | ||


