-
-
Save Andrew-Reid/f66c7bd795f156f1372cb436175b9b40 to your computer and use it in GitHub Desktop.
addHeadersDSV v5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20180601 000000;1.168200;1.168240;1.168140;1.168230;0; | |
20180601 000100;1.168220;1.168230;1.168190;1.168190;0; | |
20180601 000200;1.168180;1.168180;1.168080;1.168120;0; | |
20180601 000300;1.168130;1.168160;1.168130;1.168140;0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
<script> | |
var time_parse = d3.timeParse( '%Y%m%d %H%M%S'); | |
var time_format = d3.timeFormat('%H%M'); | |
var dsv = d3.dsvFormat(";"); | |
var headers = ["time;number1;number2;number3;number4;number5;\n"] | |
d3.text("dsv.dsv").then(function(text) { | |
var data = dsv.parse(headers+text); | |
data.forEach(function(e,i){ | |
data[i].time = time_parse(e.date); | |
}) | |
console.log(data); | |
console.log(data.columns); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment