生成垂直柱状图这一章节,我的报错了,scale_x(d.year)未起作用
var bar = chart.selectAll("g")
.data(data)
.enter()
.append("g")
.attr("transform", function(d,i) { return "translate(" + scale_x(d.year) + ",0)";})
//d3.min.js:1 Error: <g> attribute transform: Expected number, "translate(undefined,0)".