Built with blockbuilder.org
Last active
March 6, 2018 17:49
-
-
Save santiagogaray/4b240e8e29f0fee41bcec37845dc425e to your computer and use it in GitHub Desktop.
Tut1
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> | |
</head> | |
<body> | |
<script> | |
// Feel free to change or delete any of the code you see in this editor! | |
var dataArray = [20, 40, 50]; | |
var canvas = d3.select("body").append("svg") | |
.attr("width", 500) | |
.attr("height", 500); | |
s = canvas.selectAll("svg") | |
.append("line") | |
//.x(function(d) {return d.x;}) | |
var bars = canvas.selectAll("rect") | |
.data(dataArray) | |
.enter() | |
.append("rect") | |
.attr("width", function(d) {return d;}) | |
.attr("height", 50) | |
.attr("y", function(d, i) {return i *100}); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment