Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 69: | Rivi 69: | ||
} | } | ||
− | var table = []; | + | var table = []; |
− | + | ||
− | |||
− | |||
firstW = Math.floor( firstW/10 ) * 10; | firstW = Math.floor( firstW/10 ) * 10; | ||
lastW = Math.floor( lastW/10+1 ) * 10; | lastW = Math.floor( lastW/10+1 ) * 10; | ||
− | + | for ( var y=firstW; y<(lastW+1); y++ ) { | |
− | |||
− | |||
if ( typeof data[y] != 'undefined' && typeof data[y].freeze != 'undefined' && typeof data[y].breakup != 'undefined' ) { | if ( typeof data[y] != 'undefined' && typeof data[y].freeze != 'undefined' && typeof data[y].breakup != 'undefined' ) { | ||
//row = [ y, data[y].freeze, data[y].freeze, data[y].breakup, data[y].breakup ]; | //row = [ y, data[y].freeze, data[y].freeze, data[y].breakup, data[y].breakup ]; | ||
Rivi 90: | Rivi 86: | ||
} | } | ||
− | + | ||
− | + | var dataTable = new google.visualization.DataTable(); | |
− | + | dataTable.addColumn('Date', 'Winter'); | |
− | + | dataTable.addColumn('Low', 'Freezing'); | |
+ | dataTable.addColumn('Open, 'Freezing'); | ||
+ | dataTable.addColumn('Close', 'Ice break-up'); | ||
+ | dataTable.addColumn('High', 'Ice break-up'); | ||
+ | dataTable.addColumn({role: 'tooltip'}); | ||
+ | |||
+ | dataTable.addRows( table ); | ||
var options = { | var options = { | ||
Rivi 103: | Rivi 105: | ||
var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div')); | var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div')); | ||
− | chart.draw( | + | chart.draw( dataTable, options); |
}); | }); |