나는 틀린 나무를 짖고있다라고 생각한다 - 콘솔에서 나를 도와 주는데 오류가 없다.경로에 텍스트를 추가하는 방법
나는 코드 블록있어 :
이var path = svg.data([json]).selectAll("path")
.data(partition.nodes)
.enter()
.append("path")
.attr("display", function(d) {
return d.depth ? null : "none";
})
.attr("d", arc)
.style("stroke", "#fff")
.style("fill", function(d) {
return color((d.children ? d : d.parent).name);
})
.attr("fill-rule", "evenodd")
.style("opacity", 1)
.each(stash);
//>>this section functions ok
path.append("title")
.text(function(d) {
return d.name + ": " + d.amount;
});
//>>this section throws no errors but "foo" does not appear
path.append("text")
.text(function(d) {
return "foo";
})
.style("stroke", "#3b5998")
.style("fill", "#3b5998");
path.append("title")...
을 시작하는 코드가 작품을 좋아하지만 path.append("text")...
를 시작하는 마지막 조각이 HTML로 텍스트 foo는 추가하지만이 웹 페이지에 표시되지 않습니다 - 왜 보이지 않습니까? 라벨을 어떻게 추가합니까?
http://plnkr.co/edit/q9ODd5?p=preview
모든 당신이 할 수 있습니다이있을 수 있습니다 [* "D3.js로 호에 텍스트 배치"* (http://www.visualcinnamon.com/2015/09/placing-text-on-arcs.html). 시간이 가치가있어! – altocumulus
@altocumulus 위대한 링크 - 고마워 .... 봐! http://run.plnkr.co/plunks/V4Zr16/ – whytheq