在x轴上的dateTime的最大间隔最大间隔? [英] Highcharts max interval for dateTime in x-axis?

查看:83
本文介绍了在x轴上的dateTime的最大间隔最大间隔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有每日图表,横跨00:00到23:59。但是对于实时数据,假设当前是9AM,默认情况下它将从00:00到09:00拉伸图形,这对我来说不太好看。我想要的是同一天23:59的x轴最大值,因此它将显示为09:00 - 23:59为空白。我试过 $ graph [xAxis] [max] =(time()+ 86400)* 1000 但无济于事。有什么建议吗?谢谢!

I have a daily graph, spanning across 00:00 to 23:59. but for live data, let's say currently is 9AM, by default it will stretch the graph from 00:00 - 09:00, which doesn't look nice to me. What I want is the x-axis max at 23:59 of the same day, so it will show 09:00 - 23:59 as blank. I tried $graph["xAxis"]["max"] = (time()+86400)*1000 but without avail. any suggestion? thanks!

推荐答案

Highcharts只显示指定的最后一个数据点。如果要强制它显示0900 - 23:59,则必须将所有数据点传递给您想要显示的那些时间,但是值为null null 。以下是一个示例: jsfiddle示例

Highcharts will only show the last data point that is specified. If you want to force it to show the 0900 - 23:59 you will have to pass it all the data points for the those times you want displayed, but for the value pass null. Here is an example: jsfiddle example.

一旦数据点结束小时范围将自动格式化数据时间标签。您可能希望通过 dateTimeLabelFormats 来控制数据标签的格式。

Once the data points go over the hour range it will automatically format the datatime labels differently. You may want to control the formatting of the data labels via dateTimeLabelFormats.

这篇关于在x轴上的dateTime的最大间隔最大间隔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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