Hello I want in my chart to display the datetime, I made some search over
the stack and I found similaer problems like this
<http://stackoverflow.com/questions/9572052/how-to-convert-mysql-datetime-value-to-google-chart-api-datetime>
one
but I could not understand how to fix that.
The part of the code that i believe that i should change is the below..
$rows = array();
$table = array();
$table['cols'] = array(
// Labels for your chart, these represent the column titles.
array('label' => 'Date Time', 'type' => 'number'),
array('label' => 'Sensor Value', 'type' => 'number')
);
/* Extract the information from $result */
foreach($result as $r) {
$temp = array();
// The following line will be used to slice the chart
$temp[] = array('v' => (int) $r['datetime']);
// Values of the each slice
$temp[] = array('v' => (int) $r['sensorValue']);
$rows[] = array('c' => $temp);
}
$table['rows'] = $rows;
// convert data into JSON format
$jsonTable = json_encode($table);//echo $jsonTable;
My chart right now look like this ...
[image: enter image description here]
and what i want is instead of 1000,2000...5000 to display the datetime from
the data that I am displaying.
My database table that contains the datetime is the below...
[image: enter image description here]
Can you help me please??? :)
--
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.