0

I use this code to view a graph from CSV data but the Points are not connected where values are missing. What is wrong?

It does work when I embed the data in the code.

  g = new Dygraph(document.getElementById("graphdiv"), "log.csv", {
          connectSeparatedPoints: true
      });

Content of log.csv:

2013/10/11 23:05:18,,,3600
2013/10/11 23:05:20,,,1800
2013/10/11 23:05:21,,900,
2013/10/11 23:05:24,,1200,
2013/10/11 23:05:27,360,,
2013/10/11 23:05:29,,720,
2013/10/11 23:05:34,,720,
2013/10/11 23:05:35,450,,
2013/10/11 23:05:42,514,,164
2013/10/11 23:05:43,,400,
2013/10/11 23:05:46,,1200,
2013/10/11 23:05:51,,,400
2013/10/11 23:05:54,,450,
2013/10/11 23:05:57,240,,
2013/10/11 23:05:58,3600,,
2013/10/11 23:05:59,,720,
2013/10/11 23:06:10,300,,
2013/10/11 23:06:18,450,,
2013/10/11 23:06:22,,157,
2013/10/11 23:06:25,,,106
2013/10/11 23:06:28,,,1200
2013/10/11 23:06:31,277,,
4

1 回答 1

0

尝试下载最新版本的库并替换您正在使用的库。

问题在于您的 dyGraph 库。当我下载并使用您正在使用的库时,它不起作用。具体来说,您在服务器上拥有的 dygraph-combined.js。它适用于我自己的副本以及可用于调试的dygraph-dev副本。

以下是您的代码运行良好的屏幕截图:

您的代码工作的屏幕截图

我不知道为什么该库不起作用,但也许只是确保您下载了最新版本,如果这不起作用,您可以考虑这个问题。

于 2013-10-22T13:50:14.047 回答