使用highcharts处理unix时间戳 [英] Handling unix timestamp with highcharts

查看:220
本文介绍了使用highcharts处理unix时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jsfiddle: http://jsfiddle.net/RjPRd/

时间&标签显示不正确。

Times & Labels are displayed incorrectly.

我认为Javascript Time的时间戳应乘以1000,但最佳方法是什么?另外我认为设置仍然不正确,因为标签看起来与光标所在的位置相反。

I think the timestamp should be multiplied by 1000 for Javascript Time but what's the best approach? Also I believe the setup is still incorrect because the labels seem opposite to where the cursor is.

推荐答案

你说得对,时间戳在Javascript是毫秒,因此您应该将所有内容乘以1000。

You are right, timestamps in Javascript are milliseconds so you should multiply everything by 1000.

对于另一个问题,它来自您的数据向后排序的事实。当系列没有正确订购时,显然HighCharts正在搞乱。

For the other problem it comes from the fact that your data is ordered backwards. Apparently HighCharts is messing up when the series are not properly ordered.

这是你的代码的修正: http://jsfiddle.net/cvedovini/RjPRd/2/

Here's the correction for your code: http://jsfiddle.net/cvedovini/RjPRd/2/

这篇关于使用highcharts处理unix时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆