D3 projects: make a bar chart. heightofSvg -multiplier * d not working to invert chart bars

D3 projects: make a bar chart. heightofSvg -multiplier * d not working to invert chart bars
0.0 0

#1

Hi,

I’m making my bar chart following the steps we took during the challenges. Here’s my pen:

Basically in order to invert the bars, I’m doing this:
.attr("y", (d, i) => h - 6 * d)

If I delete d and just substract 6 from the height of the svg, the bar are effectively put on the bottom, but theyre all the same height (of course). The problem is when I add the multiplication by d.

Does anyone know why this is happening and how can I fix it?

Thanks!!