Code:
function drawChart3() {
// Create the data table.
var json2 = $.ajax({
url: 'statsfull_getdata1.php?type=details', // make this url point to the data file
dataType: 'json',
async: false
}).responseText;
// Create our data table out of JSON data loaded from server.
var data2 = new google.visualization.DataTable(json2);
var options2 = {
title: 'Ad Details',
chartArea:{left:260,top:50},
width: 1200,
height: 1000
};
// Instantiate and draw our chart, passing in some options.
//do not forget to check ur div ID
var table1 = new google.visualization.Table(document.getElementById('chart_main'));
function selectHandler() {
var selectedItem = table1.getSelection()[0];
if (selectedItem) {
var topping = data.getValue(selectedItem.row, 0);
alert('The user selected ' + topping);
}
}
// Add our selection handler.
google.visualization.events.addListener(table1, 'select', selectHandler);
//setInterval(drawChart, 500 );
// The select handler. Call the chart's getSelection() method
table1.draw(data2, options2);
}