Skip to content

Instantly share code, notes, and snippets.

@amitkaps
Last active October 5, 2015 21:41
Show Gist options
  • Save amitkaps/0f3ca1b6b21ee64b61f5 to your computer and use it in GitHub Desktop.
Save amitkaps/0f3ca1b6b21ee64b61f5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<script src="../lib/d3.min.js"></script>
<div id="chart"></div>
<script>
var data = [5, 25, 15, 20, 10];
d3.select("#chart")
.selectAll("div")
.data(data)
.enter().append("div")
.style("width", function(d) { return d * 10 + "px"; })
.style("height", 25 + "px")
.style("margin", 5 + "px")
.style("background-color", "brown")
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment