y轴g.append("g").call(y_axis).append("text").text("price($)").attr("transform","rotate(-90)")//将文字逆时针旋转90度。attr("text-anchor","end")//设置文本的对齐方式,使其相对于其当前位置向右移动一定距离,即偏移自身的x轴。attr("dy","1em")//这里设置y轴文本的偏移量,表示价格($)设置完成

y轴g.append("g").call(y_axis).append("text").text("price($)").attr("transform","rotate(-90)")//将文字逆时针旋转90度。attr("text-anchor","end")//设置文本的对齐方式,使其相对于其当前位置向右移动一定距离,即偏移自身的x轴。attr("dy","1em")//这里设置y轴文本的偏移量,表示价格($)设置完成