Question

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,,
Was it helpful?

Solution

Try downloading the latest version of the library and replace the one you are using.

The problem is with your dyGraph library. When I downloaded and used the library you are using, it doesn't work. Specifically, dygraph-combined.js that you have on your server. It works fine with my own copy, and also the dygraph-dev copy that you can use for debug.

Below is a screenshot of your code working fine:

Screenshot of your code working

I don't know why the library isn't working, but perhaps just make sure you download the latest version and if that doesn't work you can consider that question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top