작은 문제. 막 대형 차트가 있는데 'mouseenter'의 줄에 텍스트를 표시하고 싶습니다. 잘 작동하지만 'mouseout'에서이 텍스트를 제거하고 싶습니다. 멈추지 않을 것 같습니다.mouseout 이벤트에서 텍스트 제거
도움 주셔서 감사합니다. 첨부 다음 d3.js 스크립트
d3.selectAll("div.line")
.append("div")
.attr("class","bar")
.style("width", function(d){return d.occurrence /10 + "px"})
.on("mouseenter", function(d) {
d3.select(this)
.append("text")
.text(function(d){return d.occurrence + " occurences"});
})
.on("mouseout", function(d) {
d3.select(this)
.select(".text").remove();
});
불투명도를 사용하는 것이 더 간단 할 수 있습니다.'스타일 ("불투명도", 1)'텍스트 보이기','style ("opacity", 0)'숨기기. – FernOfTheAndes