0
Good night
I wonder if anyone ever caught this mistake while creating the charts by Google Charts
a. getTime is not a Function
Return of the Json
{"cols":[{"label":"Nome","type":"string"},{"label":"Data","type":"date"},{"label":"Quantidade","type":"number"}],"rows":[{"c":[{"v":"Leonardo"},{"v":"2019-05-02"},{"v":"229"}]},{"c":[{"v":"Leonardo"}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div id="teste" style="width: 900px; height: 500px"></div>
<script>
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
url: "control/getTeste.php",
dataType: "json",
async: false,
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var chart = new google.charts.Bar(document.getElementById('teste'));
chart.draw(data, null);
}
</script>
</body>
</html>
Adjustment as string and worked @user140828
– Bruno Ferreira