Hi Marium,

It would help to see the generated script code, but from what I can guess,
you are putting the hours and minutes in separate columns rather than as
part of one timeofday value.  A single timeofday value is an array with
three elements, [hours, minutes, seconds], and that array must be provided
as one value in one column.  Hope that helps.

On Sun, Apr 5, 2015 at 7:28 AM, mariummalik22 <[email protected]>
wrote:

> I have to plot timeofday. I have extracted my times, minutes and seconds
> and now I want to define them in json. Whenever I just put a single
> variable, it takes it as seconds and plots it. and when I write
> $dt1,$dt2,$dt3 so that it takes 3 values, it does not plot the graph. Can
> someone please tell me that how can I make it understand that it has to
> consider the 3 variables as hours, minutes and seconds. I have attached my
> result when I enter single value.  My code for json is:
>
>  echo "{ \"cols\": [
> {\"id\":\"\",\"label\":\"Name-Label\",\"pattern\":\"\",\"type\":\"timeofday\"},
> {\"id\":\"\",\"label\":\"PointSum\",\"pattern\":\"\",\"type\":\"number\"}
> ], \"rows\": [ ";
>
>   $total_rows = mysql_num_rows($result);
>
>   $row_num = 0;
>
>   while($row = mysql_fetch_array($result)){
>
>  $row_num++;
>
>
>    $date = strtotime($row['Time']);
>      $date2 = date("H:i:s",$date); // Gives time with colon
>
>      $dt1= date("H",$date); // Extracts hours from time
>
>
>      $dt2= date("i",$date); //Extracts minutes from time
>
>     $dt3= date("s",$date); // Extracts seconds from time
>
>
>
> if ($row_num == $total_rows){
>       echo "{\"c\":[{\"v\":\"" . $dt1 . "\",\"f\":null},{\"v\":" . $dt2 .
> ",\"f\":null}]}";
>     } else {
>       echo "{\"c\":[{\"v\":\"" . $dt1 .  "\", \"f\":null},{\"v\":" . $dt2
> . ",\"f\":null}]}, ";
>     }
>   }
>   echo " ] }";
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization 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-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization 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-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to