如何在“highcharts”中传递时间? [英] How to pass time in "highcharts"?

查看:93
本文介绍了如何在“highcharts”中传递时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ chart-> series [] = array('data'=>阵列()); 
在数组中我有字符串
中的数据1 =>字符串'11:03:01'(长度= 8)
2 =>字符串'11:07:56'(长度= 8)


$ div class =h2_lin>解决方案

没有办法直接发送一次。



如何处理测量时间取决于您正在尝试执行的操作。
如果您想在x轴上使用时间来跟踪一天中的数据,最好的方法是使用完整日期时间字符串,作为时期时间戳( http://en.wikipedia.org/wiki/Unix_time

如果你是按时间跟踪数据,但不是特定日期,您仍然需要使用完整日期戳记 - 在这种情况下,如果您要跟踪多个系列中的多个日期,则需要使用相同日期为每个系列,将各个时间戳添加到基本日期。



对于其他各种用途,发送数字值而不是时间值更好(即如果你想发送10小时30分钟,你可以发送10.5而不是10:30)

i am passing data like this

$chart->series[] = array('data' => array());
in array i have data in string  
1 => string '11:03:01' (length=8)
2 => string '11:07:56' (length=8)

How i pass this time data in bar charts?

解决方案

There is no way to send just a time, directly.

How to handle measuring times will depend on what exactly you're trying to do. If you want to use time on your x axis to track data throughout the day, the best method is to use the full date time string, sent as an epoch timestamp ( http://en.wikipedia.org/wiki/Unix_time )

If you are tracking data by time, but not for a particular date, you will still need to use the full date stamp - in such a case, if you are tracking multiple dates in multiple series, you will need to use the same date for each series, appending the individual time stamps to the 'base' date.

For various other uses, sending a number value instead of a time value will work better (ie if you want to send 10 hours, 30 minutes, you can send 10.5 instead of 10:30)

这篇关于如何在“highcharts”中传递时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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