I'm writing a new code for displaying a chart using data from mysql, however I wasn't able to get any trendlines appearing and apparently the reason is that the API sees my both columns as numbers, rather than a date and a number.
I tried simply putting braces around my column names and giving them some data types like this [{label: 'ActivationDate', type: 'date'},{label: 'dial count', type: 'number'}] but it renders another kind of a message which is "c.getTimezoneOffset is not a function×".
Any help with rewriting this would be appreciated. Thanks,
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart(){
var data = new google.visualization.DataTable();
var data = google.visualization.arrayToDataTable([
['ActivationDate','dial count'],
<?php
while($row = mysqli_fetch_assoc($aresult)){
echo "['".$row["activationdate"]."', ".$row["dialcount"]."],";
}
?>
]);
You can create JSON first with the data you have and put it in as jsonData.
Reference from link.