Hi folks, My code as following:
var svgns = "http://www.w3.org/2000/svg"; //Step 1: create one lable var dat= svgDoc.createTextNode("I am one rect"); var t = svgDoc.createElementNS(svgns,"text"); t.setAttributeNS(null,"x",6); t.setAttributeNS(null,"y",20); t.setAttributeNS(null,"text-anchor", "start"); t.appendChild(d); //Step 2: create one rectangle to wrap the label created in step 1 var r = svgDoc.createElementNS(svgns, "rect"); r.setAttributeNS(null, "x", 5); r.setAttributeNS(null, "y", 5); r.setAttributeNS(null, "width", 40); //here is dynamic number will be adjusted accrdoing to the label width r.setAttributeNS(null, "height", 40); I want to get the width of the text node to make the rect can wrap the label very well, but I can only get the number of letters, anyone knows how to get it? much appreciate for your help in advanced. ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/