Datetime flot图在ie11上不起作用
我的flot图在firefox和chrome上呈现良好,但在ie11上却无法呈现。图形显示时没有数据点Datetime flot图在ie11上不起作用,datetime,internet-explorer-11,flot,Datetime,Internet Explorer 11,Flot,我的flot图在firefox和chrome上呈现良好,但在ie11上却无法呈现。图形显示时没有数据点 var options = { "xaxis" : { "mode" : "time", "timeformat" : "%d/%m", //"tickSize" : [1, "day"] }, "yaxes" : [{ "position" : "left", //"tic
var options = {
"xaxis" : {
"mode" : "time",
"timeformat" : "%d/%m",
//"tickSize" : [1, "day"]
},
"yaxes" : [{
"position" : "left",
//"tickSize" : 1,
"min" : min,
"max" : 100
}, {
"position" : "right",
"min" : 0,
"max" : max
}
],
"series" : {
"lines" : {
"show" : true
},
curvedLines: {
apply: true,
}
},
"colors" : ["#00ff00"],
"legend" : {
"show" : false
},
"grid" : {
hoverable: true,
clickable: true
}//,
//animator: { start: 100, steps: 99, duration: 2000, direction: "left" }
};
var data_ajax = [{
"color" : "#A8B400",
"label" : "R1 Graph",
"lines" : {
"show" : true,
"lineWidth" : 1
},
"points" : {
"show" : false
},
"yaxis" : 1,
"data" : arr
}
];
$('#network-graph').empty();
plot = $.plot("#network-graph", data_ajax, options);
我发现的问题是data\u ajax
变量。它包含格式错误的对象。对于IE11修复,我必须使用的时间格式如下
var to_seconds = moment(data[i].TIMESTAMP, 'YYYY-MM-DD hh:mm A').unix() * 1000;
我以前没有指定格式。是否有一种通用的日期时间格式可用于所有浏览器?能否创建一个复制此问题的文件?适用于IE11和Chrome。时间戳(毫秒)是JavaScript日期的通用(或基本)格式。从PHP返回这些,您应该不会有问题(读取文本格式日期的
Date.parse()
函数在某种程度上依赖于浏览器,但所有浏览器都应该理解默认的ISO格式)。如何使其在js和时区感知中工作?