2014-10-10 100 views

回答

2

小的代碼,以便它旁邊的你的意思是每個值?即像這樣

text = summary.append "text" 
    .attr "text-anchor": "end", x: 250 
text.append "tspan" 
    .text "R$ " 
    .attr "class": "summary-currency" 
text.append "tspan" 
    .text (d) -> d3.format(',.0f') d 
    .attr "class": "summary-value" 
+0

必須是兩個不同的元素文本(一個用於數字,另一個用於'R $'),因爲每個文本都會有不同的樣式(如圖像)。 – ridermansb 2014-10-10 13:04:12

+0

然後你需要tspans。我已經調整了我的答案。 – 2014-10-10 13:29:53