SHEFALI
unread,May 30, 2012, 3:26:10 AM5/30/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to d3-js
Hello all,
can any one suggest how to precompute the size of text and accordingly
draw an ellipse around it.
Following is the snippet from the code
new_g.append("svg:ellipse")
.attr("cx", bbox.x+25)
.attr("cy", bbox.y+13)
.call(force.drag)
.attr("rx",function(d) {var ttx=d.screen_name ; return
(ttx.length + 40)})
.attr("ry",13)
.style("fill-opacity", ".2")
.style("stroke", "#666")
.style("stroke-width", "1.5px")
.style("fill", function color(d) { if (d.expanded=="true")
return "red"; else return "none"});
The problem encountered here is that for long text, it does not fit
within the ellipse.please help