Hi
Right now my timeline chart doesn't show up at all in my web page I am not
sure what is wrong with my code is not given me any errors. Could you
please tell me where went wrong? Thanks
<?php
$sth = "SELECT * FROM goal WHERE account_id =$account_id";
$result4 = mysqli_query($con,$sth) or die(mysqli_error());
$rows = array();
$table = array();
$table['cols'] = array(
array('type' => 'string', 'label' => 'goalName'),
array('type' => 'date', 'label' => 'starts'),
array('type' => 'date', 'label' => 'finish')
);
//$rows = array();
while($rows = mysqli_fetch_assoc($result4)) {
$temp = array();
$temp[] = array('v' => (string) $rows['goalName']);
$temp[] = array('v' => (string) $rows['starts']);
$temp[] = array('v' => (string) $rows['finish']);
$rows[] = array('c' => $temp);
}
$table['rows'] = $rows;
$jsonTable = json_encode($table);
//echo $jsonTable;
?>
*Chart: *
<script type="text/javascript"
src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization',
'version':'1','packages':['timeline']}]}"></script>
<script type="text/javascript">
google.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('example3.1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
var data = "" google.visualization.DataTable(<?php echo
json_encode($table, JSON_NUMERIC_CHECK); ?>);
var options = {
title: 'Progress',
is3D: true
var options = {
timeline: { colorByRowLabel: true }
};
chart.draw(dataTable, options);
}
</script>
--
You received this message because you are subscribed to the Google Groups
"Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-chart-api.
For more options, visit https://groups.google.com/d/optout.