The following error appears
Invalid data table format: column # 0 must be of type 'string'.
At this point I have the return in json this way:
[{"Field":"OrderTask","Old":"1","New":"2","Modified":"2016-12-08 11:16:27"},
{"Field":"Status","Old":"1","New":"4","Modified":"2016-12-08 13:43:51"}]
And I have the following Google Chart code:
$("#dataTables-tasks tbody").on("click", "tr", function(){
var idTask = $(this).find('td.id-task').html();
google.charts.load('current', {'packages':['gantt']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
url: "../connect/post/select.php",
dataType: "json",
data:'numIdTask='+idTask
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {
width: 550,
height: 400,
gantt: {
trackHeight: 30
}
};
var chart = new google.visualization.Gantt(document.getElementById('chart_div'));
chart.draw(data, options);
}
});