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

后端 未结 4 2044
旧巷少年郎
旧巷少年郎 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:23

    A thing that was counter intuitive and caused me to create some upside down graphs is the svg coordinates x,y start 0,0 at the top left corner, rather than the bottom left corner.

提交回复
热议问题