You can transform epoch time into javascript Date objects in the Date
object constructor:
var date = new Date(epochTime);
which you can use to input the epoch time into a DataTable; or, if you
already have epoch time in your DataTable, you can use a DataView (or the
"view" parameter of a ChartWrapper) to handle the transform and output Date
objects for your chart:
var view = new google.visualization.DataView(data);
view.setColumns([{
type: 'date',
label: 'date column label',
calc: function (dt, row) {
return new Date(dt.getValue(row, 0)); // assumes column 0 is the
epoch time
}
}, 1 /*[, 2 [, 3 [, etc]]]*/);
On Friday, June 7, 2013 2:47:56 AM UTC-4, Uddhav Arote wrote:
>
> Hi all,
> I want to plot a real time per second data using Linechart. I get an
> epoch time and 63 values at that time as string. How to convert my epoch
> time,say 130567440 into timeofday or date or time format, accepted by the
> visualization api
>
> Thank you !
>
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.