I’m working on the D3 GDP project and I’m most of the way done. I can’t figure out how to adjust the width of both the X and Y axes. The numbers on the vertical (Y) axis are cut off due to the axis not being wide enough. I’d also like to make the X access wider too so I can add a label.
It’s hard to find clear documentation on this online.
I think what makes it hard to adjust the axes is because you hardcoded the 40 in their translate attributes. After I tried replacing them with margin.left, I was able to freely adjust the left and right margins and the graph adjusts nicely.
Somehow though, adjusting the right margin translates the bars downwards. The translate's Y part should be 0 instead of margin.right.