Last active
March 20, 2017 13:44
-
-
Save gujc71/f82bbcc35d1b37e12949350f8e4d8701 to your computer and use it in GitHub Desktop.
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"> | |
<svg width="500" height="300"></svg> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script> | |
var dataset = [9, 19, 29, 39, 29, 19, 9]; | |
var svg = d3.select("svg"); | |
for (var i=0; i < dataset.length; i++) { | |
svg.append("rect") | |
.attr("height", dataset[i]) | |
.attr("width", 40) | |
.attr("x", 50 * i) | |
.attr("y", 100 - dataset[i]); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment