Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 207: | Rivi 207: | ||
memo.obsesA.sort( function(a, b) { return a.obsdatetime - b.obsdatetime; }); | memo.obsesA.sort( function(a, b) { return a.obsdatetime - b.obsdatetime; }); | ||
− | + | // create DataTable | |
+ | memo.data = new google.visualization.DataTable(); | ||
+ | |||
+ | // col for xAxis values | ||
+ | memo.data.addColumn( 'date', 'time' ); | ||
+ | |||
+ | // make ticks for y axis on cat types | ||
+ | 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 = '#fff'; | ||
+ | memo.options.vAxis.baselineColor = 'none'; | ||
+ | } else if ( typeof i18n[memo.obscode]['min'] != 'undefined' ) { | ||
+ | memo.options.vAxis.viewWindow = { min: i18n[memo.obscode]['min'] }; | ||
+ | } else if ( memo.obsMinValue >= 0) { | ||
+ | memo.options.vAxis.viewWindow = { min: 0 }; | ||
+ | } | ||
+ | |||
+ | if (memo.graphType == 'trend') { | ||
+ | |||
+ | //addDataToTrendChart(memo); | ||
+ | |||
+ | } else if (memo.graphType == 'season') { | ||
+ | |||
+ | //addDataToSeasonChart(memo); | ||
+ | |||
+ | } else if (memo.graphType == 'dateofyear') { | ||
+ | |||
+ | //addDataToDateOfYearChart(memo); | ||
+ | |||
+ | } | ||
data = {}; | data = {}; |