i have code like this but its not working
var t = r.text(100,开发者_运维技巧 100, 'test');
t.attr({font-size: 16});
giving me error
missing : after property id
here is documentation for raphael.js http://raphaeljs.com/reference.html
For attributes with a hyphen in the name, you need to use a string literal.
var t = r.text(100, 100, 'test');
t.attr({ "font-size": 16, "font-family": "Arial, Helvetica, sans-serif" });
Check the below lines:
var text1 = paper.text(top, left, `Your Text`);
text1.attr({ "font-family": "arial", fill: "black", "font-size": 12 });
精彩评论