google.charts.load('current', {
'packages': ['table']
});
google.charts.setOnLoadCallback(drawTable);
function drawTable() {
var dataTable = new google.visualization.DataTable();
// determine the number of rows and columns.
var numRows = newData.length;
var numCols = newData[0].length;
dataTable.addColumn('string', newData[0][0]);
for (var i = 1; i < numCols; i++)
dataTable.addColumn('string', newData[0][i]);
// now add the rows.
for (var i = 1; i < numRows; i++)
dataTable.addRow(newData[i]);
var cssClassNames = {
'tableRow': 'gold-border',
'oddTableRow': 'beige-background',
'headerCell': 'gold-border',
'tableCell': 'gold-border'
};
var options = {
showRowNumber: false,
width: '100%',
height: '100%',
page: 'disable',
pageSize: 1,
allowHtml: true,
pagingSymbols: {
prev: 'Prev',
next: 'Next'
},
'cssClassNames': cssClassNames,
pagingButtonsConfiguration: 'auto'
};
// redraw the chart.
var chart = new google.visualization.Table(document.getElementById('gauge_div'));
chart.draw(dataTable, options);
}
这里显示的是1,2,3,4而不是这个我想要最初的1,2一旦点击2或下一个它应该显示下一个3,4等等..
问题就在这里,如果我的数据大小是 100,那么它显示1,2,3,4,5,6,7,8,9,10, .... 100 所以这是个问题。谁能帮我解决这个问题。