d3
一、柱形图
1.选择集
d3.select
()
d3.selectAll
()
2.数据绑定
<div>Apple</div>
<div>Banana</div>
<div>Cat</div>
<div>Dog</div>
var num = 35;
var body = d3.select("body");
var div = body.selectAll("div");
div.datum(num);
div.text(funciton(d, i){ return d + " " + i; });
console.log(div);
var dataset = [10, 20, 30, 40, 50];
var update = div.data(dataset).text(function(d){ return d; });
var enter = update.enter().append("div").text(function(d){ return d; });
var exit = update.exit().remove();
console.log(update);
console.log(update.enter());
console.log(update.exit());