I am not storing values like 2000 . I am using SQL and in my database table 
I have a column named datetime which is type of datetime and everytime I 
insert a new data it automatically stores the date (year, month , date) and 
the time 

Τη Τρίτη, 28 Απριλίου 2015 - 10:30:25 μ.μ. UTC+3, ο χρήστης Sergey 
Grabkovsky έγραψε:
>
> Hi Nick,
>
> I'm a little confused about how your data is structured. If you're storing 
> values like '2000' for your database's datetime value, I'm not quite sure 
> how that's supposed to translate to a date.
>
> Ultimately, you will have to use JavaScript Date objects in order to get 
> the chart to interpret your data as dates. This page may help you out: 
> https://developers.google.com/chart/interactive/docs/datesandtimes
> I think the "Dates and Times Using the Date String Representation" section 
> will be especially relevant to you.
>
> On Tue, Apr 28, 2015 at 3:19 PM Nick Bourlai <[email protected] 
> <javascript:>> wrote:
>
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/google-chart-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.

Reply via email to