세로 막 대형 차트에 사용 된 툴팁을 가로 막 대형 차트에 사용 된 것으로 번역하려고합니다. 마우스 오버시 강조 할 막대를 가져 왔지만 툴팁이 나타나지 않습니다. 그래서 내 질문은 무엇을 놓치고 무엇입니까? 툴팁의 방향을 설정해야하는 곳이 있습니까? 또는 툴팁을 올바르게 호출하지 않습니까? 당신은 제대로 툴팁를 호출하지 않는 http://plnkr.co/edit/JhMRSAvxmvjqP4kE3X5v?p=previewD3JS 막대 차트 세로 방향에서 가로 방향으로의 도구 설명
<style>
.d3-tip {
line-height: 1;
font-weight: bold;
padding: 12px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
border-radius: 2px;
}
/* Creates a small triangle extender for the tooltip */
.d3-tip:after {
box-sizing: border-box;
display: inline;
font-size: 10px;
width: 100%;
line-height: 1;
color: rgba(0, 0, 0, 0.8);
content: "\25BC";
position: absolute;
text-align: center;
}
/* Style northward tooltips differently */
.d3-tip.n:after {
margin: -1px 0 0 0;
top: 100%;
left: 0;
}
</style>
var tip = d3.tip()
.attr('class', 'd3-tip')
.offset([-10, 0])
.html(function(d) {
return "<strong>% Change in Income:</strong> <span style='color:#FFFFFF'>" + d.name;
})
이것은 매우 유용합니다. 나는 원래 번역본에서와 같이 svg.call (팁)을 알고 있어야했다. 당신이 추가 한 두 라인은 아마 알아 내지 못했을 것입니다. 대단히 감사합니다! –