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);
}
Here it's showing 1,2,3,4 instead of this I want initially 1,2 once click on 2 or next it should show next 3,4 and so on..
The problem is here if my data size is 100 then its showing 1,2,3,4,5,6,7,8,9,10, .... 100 So it's a problem. Could anyone please help me on this.
Use the
pagingButtons
configuration option. See docsExample:
Run the following snippet that uses
pagingButtons:2
: