正确显示JQSuite JQChart的日期 [英] Displaying Dates Correctly for JQSuite JQChart
本文介绍了正确显示JQSuite JQChart的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试格式化JQSuite JQChart以便在X轴上正确显示日期. select语句返回日期时间数据(包括毫秒).我只想以"yy/mm/dd"之类的格式绘制日期.
I'm trying to format a JQSuite JQChart to display the date correctly on the X-Axis. The select statement is returning datetime data (including milliseconds). I just want to plot the date in a format like "yy/mm/dd".
做这样的事情只会显示时间:
Doing something like this only displays times:
->setxAxis(array("title"=>array("text"=>"Maturity Date"), "type"=>"datetime"))
添加此标签会丢失所有标签:
Adding this loses any labels:
"tickInterval"=> 7*24*3600*1000))
有人解决了这个问题吗?
Has anybody solved this problem?
推荐答案
好,我知道了.您必须将Unix时间戳(即1970年1月1日之后的秒)发送到网格,而不是SQL日期时间类型.
Ok, I figured this out. You must send a Unix timestamp, i.e. seconds after Jan 1, 1970, to the grid, instead of a SQL datetime type.
这篇关于正确显示JQSuite JQChart的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文