[00:58:19, 2732],
[00:58:49, 2705],
[00:59:19, 2811]
or alternatively, like this:
[2010-02-15 00:58:19, 2732],
[2010-02-15 00:58:49, 2705],
[2010-02-15 00:59:19, 2811]
but of course this won't fly. Can anyone suggest a way to get this to
work in Flotr? I'm hoping timeFormat or mode:time might be able to
help. Any guidance would be greatly appreciated.
Thanks very much,
MikeB
Use the option:
mode: "time"
and you should be away.
So your data should look like for example:
[1266195499000, 2732],
[1266195529000, 2705],
[1266195559000, 2811]
Remember that you data needs to be in the format:
[ data: [ [x0, y0], [x1, y1] ... ] ] ]
Do you know if it's possible to show both axis tick and mouse tracker
like this: 2010-02-15 12:25:56? Here's my current formatter (see
below). It blows up on the second line, returning
"datatime.getMilliseconds is not a function"; if I comment out that
line I get NaNs returned, like so: "NaN-NaN-NaN-NaN NaN:NaN:NaN".
Any additional help would be greatly appreciated. Thanks!
function testdatestamp(datatime) {
var datatime = datatime-datatime.getMilliseconds();
var localedatatime = new Date(datatime);
var year=localedatatime.getFullYear();
var month=localedatatime.getMonth()+1;
var day=localedatatime.getDate();
var hour=localedatatime.getHours();
var minute = localedatatime.getMinutes();
var second = localedatatime.getSeconds();
if (month < 10) {
month = "0"+month;
}
if (day < 10) {
day = "0"+day;
}
if (hour < 10) {
hour = "0"+hour;
}
if (minute < 10) {
minute = "0"+minute;
}
if (second < 10) {
second = "0"+second;
}
var v = year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
return v;
function testdatestamp(x) {
var localedatatime = new Date(x*1000);
var year=localedatatime.getFullYear();
var month=localedatatime.getMonth()+1;
var day=localedatatime.getDate();
var hour=localedatatime.getHours();
var minute = localedatatime.getMinutes();
var second = localedatatime.getSeconds();
if (month < 10) {
month = "0"+month;
}
if (day < 10) {
day = "0"+day;
}
if (hour < 10) {
hour = "0"+hour;
}
if (minute < 10) {
minute = "0"+minute;
}
if (second < 10) {
second = "0"+second;
}
var v = year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
return v;
//return myDate.toLocaleString();