When creating a custom plot I came across that Firefox's "Web Console" flagged an error with:
XML Parsing Error: not well-formed Location: http://192.168.1.201/testdata.dat
Line Number 1, Column 5:
The html code and the content of testdata.dat are below.
Although it says error, the page actually works as expected, but I kind of wasn't satisfied and played around a bit. I found that if I rename testdata.dat to testdata.csv and adjust the html file accordingly, the error goes away.
Is this expected? Can someone shine a light on this?
dygraphs_test.html:
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.js"></script>
<link rel="stylesheet" src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.css" />
</head>
<body>
<h3>Test</h3>
<div id="graphdiv2"></div>
<script type="text/javascript">
g2 = new Dygraph(
document.getElementById("graphdiv2"),
"testdata.dat",
{
labels: [ "Date", "Temperature", "Col3", "Col4", "Col5" ],
} // options
);
</script>
</body>
</html>
testdata.dat:
2018/01/12 17:59:04,22.18,22.34,28.44,20.31
2018/01/12 17:59:06,22.19,22.68,28.44,20.14
2018/01/12 17:59:08,22.18,22.32,28.44,20.31
2018/01/12 17:59:10,22.18,22.35,28.38,20.31
2018/01/12 17:59:12,22.18,22.37,28.38,20.31
2018/01/12 17:59:14,22.18,22.39,28.44,20.31