var circle = r.circle(25,50,10).attr({fill:'#b71e16', stroke:'#71140f'}); // set it circle.data('custom-attribute', 'value'); // get it data = circle.data('custom-attribute'); alert(data);