Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

raphael: show HTML entity within a tag

I want to add HTML entity to raphael tag, but I see the text deg and not the degree sign -

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) ...

How can I escape it?

I am not sure which language actually displays this text, HTML, JavaScript or SVG ...

enter image description here

like image 324
Atara Avatar asked Jan 22 '26 21:01

Atara


1 Answers

you can also pass fromCharCode to a raphael node.

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

would render the ° entity in a text node.

like image 123
ryan j Avatar answered Jan 24 '26 18:01

ryan j



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!