Built with blockbuilder.org
Created
June 3, 2017 13:13
-
-
Save itzikbenh/624cfbec3bc9962b77bbb1aa6bb4b419 to your computer and use it in GitHub Desktop.
fresh block
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
license: mit |
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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<body> | |
<script> | |
var dataArray = [{x:5,y:5},{x:10,y:15},{x:20,y:7},{x:30,y:18},{x:40,y:10}]; | |
var svg = d3.select("body").append("svg").attr("height","100%").attr("width","100%"); | |
var line = d3.line() | |
.x(function(d,i){ return d.x*6; }) | |
.y(function(d,i){ return d.y*4; }); | |
svg.append("path") | |
.attr("fill","none") | |
.attr("stroke","blue") | |
.attr("d",line(dataArray)); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment