Skip to content

Instantly share code, notes, and snippets.

@Andrew-Reid
Last active July 10, 2018 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andrew-Reid/5d1c7c7a2164ebde2c6ba0e3af7a281d to your computer and use it in GitHub Desktop.
Save Andrew-Reid/5d1c7c7a2164ebde2c6ba0e3af7a281d to your computer and use it in GitHub Desktop.
addHeadersDSV v4 (b)
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;
<!DOCTYPE html>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.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", function(error,data) {
var data = dsv.parse(headers + data.reponse)
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