如果点之间的差异大于 x 分钟,Dygraph 库是否有断线的设置?
Is there a setting for Dygraph library to break the line if the difference between points is larger than x minutes?
昨天我开始对一些图表使用 Dygraph 库,到目前为止我遇到的唯一问题是如果时差大于 x,我没有找到禁用点之间 "connecting line" 的方法分钟,正如您在下面的照片中看到的那样,即使我没有那些小时的数据,我的图表中有一个大面积的线条继续存在。
Area marked with RED should not have a stright line to connect the left side of the graph with the right side
是否有我可以添加到 js 文件的设置/变量,以在点之间的时间超过 x 分钟时断开该行?
这是我的部分数据:
"2017-09-08 22:26,4262.00\n"+
"2017-09-08 22:36,7095.00\n"+
"2017-09-08 22:46,7177.00\n"+
"2017-09-09 09:16,5833.00\n"+
"2017-09-09 09:26,3903.00\n"+
如您所见,我在小时 22:46 和 09:16 之间没有行,我想在该时间段之间有一个空图表。
谢谢。
您可以通过引入人工缺失值来实现:
"2017-09-08 22:26,4262.00\n"+
"2017-09-08 22:36,7095.00\n"+
"2017-09-08 22:46,7177.00\n"+
"2017-09-09 00:00,\n"+
"2017-09-09 09:16,5833.00\n"+
"2017-09-09 09:26,3903.00\n",
这是一个 full example. For a more thorough discussion, see the missing data 页面。
昨天我开始对一些图表使用 Dygraph 库,到目前为止我遇到的唯一问题是如果时差大于 x,我没有找到禁用点之间 "connecting line" 的方法分钟,正如您在下面的照片中看到的那样,即使我没有那些小时的数据,我的图表中有一个大面积的线条继续存在。
Area marked with RED should not have a stright line to connect the left side of the graph with the right side
是否有我可以添加到 js 文件的设置/变量,以在点之间的时间超过 x 分钟时断开该行?
这是我的部分数据:
"2017-09-08 22:26,4262.00\n"+
"2017-09-08 22:36,7095.00\n"+
"2017-09-08 22:46,7177.00\n"+
"2017-09-09 09:16,5833.00\n"+
"2017-09-09 09:26,3903.00\n"+
如您所见,我在小时 22:46 和 09:16 之间没有行,我想在该时间段之间有一个空图表。
谢谢。
您可以通过引入人工缺失值来实现:
"2017-09-08 22:26,4262.00\n"+
"2017-09-08 22:36,7095.00\n"+
"2017-09-08 22:46,7177.00\n"+
"2017-09-09 00:00,\n"+
"2017-09-09 09:16,5833.00\n"+
"2017-09-09 09:26,3903.00\n",
这是一个 full example. For a more thorough discussion, see the missing data 页面。