gpt4 book ai didi

svg - raphael:在标签中显示 HTML 实体

转载 作者:行者123 更新时间:2023-12-04 18:20:11 24 4
gpt4 key购买 nike

我想将 HTML 实体添加到 raphael 标签,但我看到的是文本 deg 而不是度数符号 -

this.tags.push(
// make tag (x, y, text, degree, radius)
r.tag(this.x, this.y[i], this.values[i]+ "°C", 20, 4).insertBefore(this) ...

我怎样才能逃脱它?

我不确定哪种语言实际显示此文本,HTML、JavaScript 或 SVG ...

enter image description here

最佳答案

您还可以将 fromCharCode 传递给 raphael 节点。

r.text(100, 100, String.fromCharCode(176));

将在文本节点中呈现 ° 实体。

关于svg - raphael:在标签中显示 HTML 实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15001794/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com