Here's the version that works: fiddle
First, switching the order of the elements of the axial region from ([0,whatever]) to ([whatever,0]) will lead to a change in scale.
Secondly, a small mistake. You just used width in the y scale instead of height . Since the graph is not square, it was not the correct length!
Finally, I notice that you have a bunch of additional settings made here and there, subtracting 200, the axisMovement variable, the extra g element around your svg , etc. Thus, it will be easier for you if you clean those parts that are not needed. The goal of setting up fields using your agreement is that these additional settings are not needed. Taking advantage of elegant little tricks such as this is what makes people really connect to d3 :)
source share