Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 499: | Rivi 499: | ||
memo.data.addColumn( 'date', 'time' ); | memo.data.addColumn( 'date', 'time' ); | ||
// make ticks for y axis on cat types | // make ticks for y axis on cat types | ||
if ( i18n[memo.obscode]['type'] == 'cat') { | if ( memo.obsesA.length > 0 ) { | ||
if ( i18n[memo.obscode]['type'] == 'cat') { | |||
memo.options.vAxis.ticks = []; | |||
for (var c in i18n[memo.obscode]['catNamesShort']) { | |||
memo.options.vAxis.ticks.push({v: parseInt(c), f: i18n[memo.obscode]['catNamesShort'][c][memo.lang] }); | |||
memo.options.vAxis.ticks.push({v: parseInt(c)+0.5, f: '' }); | |||
} | |||
memo.options.vAxis.ticks.sort( function(a, b) { return a.v-b.v } ); | |||
memo.options.vAxis.viewWindow = { min: -0.5, max: parseInt(memo.options.vAxis.ticks[memo.options.vAxis.ticks.length-1].v)+0.5 }; | |||
memo.options.vAxis.gridlines.color = '#eee'; | |||
memo.options.vAxis.baselineColor = 'none'; | |||
} else if ( typeof i18n[memo.obscode]['min'] != 'undefined' ) { | |||
if ( i18n[memo.obscode]['min'] != -999 ) { | |||
memo.options.vAxis.viewWindow = { min: i18n[memo.obscode]['min'] }; | |||
} | |||
} else if ( memo.obsMinValue >= 0) { | |||
memo.options.vAxis.minValue = memo.obsMinValue; | |||
memo.options.vAxis.viewWindow = { min: memo.obsMinValue }; | |||
} | |||
memo.titleEl.html( memo.title ); | |||
if ( typeof i18n[ memo.obscode ].changes != 'undefined' ) { | |||
if ( typeof typeof i18n[ memo.obscode ].changes[ memo.lang ] != 'undefined' ) { | |||
memo.titleEl.append( ' <button style="padding: 0 0.25em; font-size: 13px; margin-bottom: 3px;" type="button" class="btn btn-secondary btn-info" data-toggle="tooltip" data-placement="top" title="' + i18n[ memo.obscode ].changes[ memo.lang ] + '">' + i18n[ 'new' ][ memo.lang ] + '</button>' ); | |||
jQuery( '[data-toggle="tooltip"]' ).tooltip(); | |||
} | |||
} | } | ||
} | } | ||
if (memo.graphType == 'trend') { | if (memo.graphType == 'trend') { | ||


