3

我想将 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 ...

在此处输入图像描述

4

2 回答 2

4

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

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

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

于 2013-04-11T15:33:42.037 回答
3

通常,您将使用 UTF 编码文件,在这种情况下,您只需输入度数字符 , 就可以了°

于 2013-02-21T12:30:34.317 回答