Svg raphael:在标记中显示HTML实体

Svg raphael:在标记中显示HTML实体,svg,raphael,html-entities,graphael,Svg,Raphael,Html Entities,Graphael,我想将HTML实体添加到raphael标记中,但我看到的是文本deg,而不是degree符号- 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 通常,您将使用

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

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


通常,您将使用UTF编码的文件,在这种情况下,您只需输入
度字符,
°
,同样。

您也可以从CharCode传递到raphael节点

r.text(100, 100, String.fromCharCode(176));
将在文本节点中呈现实体