// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', '水位站');
data.addColumn('number', '水位(m)');
data.addRows(10);
data.setCell(0, 0, '高屏溪');
data.setCell(0, 1, 12, '12.0');
data.setCell(1, 0, '中港溪');
data.setCell(1, 1, -7.3, '-7.3');
data.setCell(2, 0, 'Toys');
data.setCell(2, 1, -1, '0.5');
data.setCell(3, 0, '南湖一橋');
data.setCell(3, 1, -2.1, '-2.1');
data.setCell(4, 0, '南湖二橋');
data.setCell(4, 1, 22, '22.0');
data.setCell(5, 0, '高屏溪');
data.setCell(5, 1, 12, '12.0');
data.setCell(6, 0, '中港溪');
data.setCell(6, 1, -7.3, '-7.3');
data.setCell(7, 0, 'Toys');
data.setCell(7, 1, -1, '0.5');
data.setCell(8, 0, '南湖一橋');
data.setCell(8, 1, -2.1, '-2.1');
data.setCell(9, 0, '南湖二橋');
data.setCell(9, 1, 22, '22.0');
// Create and draw the visualization.
var table = new
google.visualization.Table(document.getElementById('visualization'));
var formatter = new google.visualization.TableArrowFormat();
formatter.format(data, 1); // Apply formatter to second column
table.draw(data, {allowHtml: true, showRowNumber: true});
沒有留言:
張貼留言