Accepted answer

Setting the orientation only affects the placement of the labels with respect to the axis line, D3 won't automatically position the axis on the canvas for you. The way this is usually done is to set a margin for the axes and offset the containers accordingly:

            .attr("class", "axis")
            .attr("transform", "translate(" + margin + "," + (1000 - margin) + ")")

            .attr("class", "axis")
            .attr("transform", "translate(" + margin + ",0)")

Complete demo here.

Related Query

More Query from same tag