Height transitions go from top down, rather than from bottom up in D3

后端 未结 4 2045
旧巷少年郎
旧巷少年郎 2021-02-09 02:54

I\'m making a bar chart with the following code:

svg.selectAll(\".bar\")
    .data(data)
    .enter().append(\"rect\")
    .attr(\"class\", \"bar\")
    .attr(\"         


        
4条回答
  •  别那么骄傲
    2021-02-09 03:24

    I think the attribute("class", bar) is not required and you can use rangeBand() to calculate width and check your Yaxis scale takes value [height,0] and rest of the code looks fine.

提交回复
热议问题