
140
9
、、き
svg.selectAll("rect")
.data(dataset); //
新しいデータのバインドに成功
9.2.3
3
rect
height
y
svg.selectAll("rect")
.data(dataset)
.attr("y", function(d) {
return h - yScale(d);
})
.attr("height", function(d) {
return yScale(d);
});
enter()
append()
rect
1
//
クリック時に新しいデータでグラフを更新する
d3.select("p")
.on("click", function() {
// dataset
の新しい値
dataset = [ 11, 12, 15, 20, 18, 17, 16, 18, 23, 25,
5, 10, 13, 19, 21, 25, 22, 18, 15, 13 ];
//
すべての