amitkaps
10/5/2015 - 9:27 PM

Bar_d3js+html.html

<!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>