当数组中的NULL值时,笔迹图不显示

时间:2018-08-15 13:30:17

标签: javascript dygraphs

如果第一行包含NULL值,则不显示dygraph。在行之间,有一些NULL,并显示为空格,确定。但是仅第一行包含NULL,而不显示dygraph。有人知道为什么吗?

Chrome控制台说:

Mismatch between number of labels (gsensorDate,x,y,z,speed) and number of columns in array (4)

我计算出的列数是正确的。

id从1开始: First row x,y,z,speed values are NULL

我通常从2开始创建ID: If first row values are present

id从1开始:

data=[[new Date(Date.parse('2018-07-01 06:49:04')),,,,],
[new Date(Date.parse('2018-07-01 06:49:15')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:16')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:17')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:18')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:19')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:20')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:21')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:22')),-0.125,0.75,-0.625,0],

id从2开始:

data=[[new Date(Date.parse('2018-07-01 06:49:15')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:16')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:17')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:18')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:19')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:20')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:21')),-0.125,0.75,-0.625,0],
[new Date(Date.parse('2018-07-01 06:49:22')),-0.125,0.75,-0.625,0],

0 个答案:

没有答案