views:

32

answers:

1

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

+1  A: 

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" });
C-Mo