我是 d3 和 svg 的新手,我尝试选择一些类来删除它们。
我的代码是;
svgBC.append("g")
.attr("class", "x axis")
.attr("transform", "translate(30," + height + ")")
.call(xAxis);
svgBC.append("g")
.attr("class", "y axis")
.call(yAxis)
.attr("transform", "translate(30,0)")
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("Population");
我想删除“y 轴”并保留 x 轴。在那之前我使用了方法删除: selectAll("g").remove
但现在我想保留图表的一部分...
那么,如何有更好的选择来删除我绘制的一部分?
谢谢
最佳答案
关于javascript - d3 svg 中的选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36181740/