我需要做类似以下的事情:
paper.text(Left, Top, " " + this._p.Label + ":");
paper.text(Left, Top, " " + this._p.Label + ":");
但是在文本中,前置空白将不会显示或显示为
。
我已经尝试过:
label.attr({"xml:space": "preserve"});
…没有效果。
有没有办法在Raphael JS中访问SVG节点,以便我可以进行设置?
setAttributeNS("http://www.w3.org/XML/1998/namespace","space","preserve");
(还有其他什么方法可以解决这个问题吗?)
element.node
来访问与 Raphael 对象相关联的 svg 元素。干杯! - Kevin Nielsen