大佬教程收集整理的这篇文章主要介绍了使用Flot jQuery插件显示具有正确时区的工具提示,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我的JSON(由AJAX生成)
[1300087800000,29],[1300088700000,39],[1300089600000,46],[1300090500000,53],[1300091400000,68],[1300092300000,95],...
$(placeholder).bind("plothover",function (event,pos,item) { $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2); var y = item.datapoint[1].toFixed(2); var currdate = new Date(Math.floor(X)); var hour = currdate.getHours(); var minute = String("") + currdate.getminutes(); var tooltip = hour + ":" + ((minute.length < 2) ? "0" + minute : minutE) + " " + (Math.round(y * 100)/100) + "Wh" showTooltip(item.pageX,item.pageY,tooltip); });
Flot选项
var plotOptions = { lines: { show: true,lineWidth: 1 },points: { show: false,symbol: "cross" },xaxis: { mode: "time",tickLength: 5,timeZoneOffset: (new Date()).getTimezoneOffset() },SELEction: { mode: "x",color: "#BCBCBC" },grid: { hoverable: true,clickable: false } };
但不幸的是,timeZoneOffset不起作用,而且我在xaxis和工具提示之间仍然有差异.
你有什么想法我应该如何解决我的问题?
以上是大佬教程为你收集整理的使用Flot jQuery插件显示具有正确时区的工具提示全部内容,希望文章能够帮你解决使用Flot jQuery插件显示具有正确时区的工具提示所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。