block by guilhermesimoes 5543253248403cef665fb1ffb58cabac

D3 V3 join & enter

Full Screen

index.html

<!DOCTYPE html>
<meta charset="utf-8">
<style>
.chart div {
  display: inline-block;
  margin: 5px;
  padding: 5px;
  border: 1px black solid;
}
</style>
<div class="chart"></div>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>

var data = ["A", "A", "A"];

var a = d3.select(".chart")
  .selectAll("div")
    .data(data, function(d) { return d; })
  .enter().append("div")
    .text(String);

</script>