How to pass time in “highcharts”?

前端 未结 3 1385
刺人心
刺人心 2020-12-12 05: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 =         


        
3条回答
  •  囚心锁ツ
    2020-12-12 05:48

    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)

提交回复
热议问题