How to add text to a raphael js element

前端 未结 2 977
暖寄归人
暖寄归人 2021-02-20 03:26

I want to add text to a element in raphael js, I have added text with

r.text(30, 20, \"ellipse\").attr({fill: color});

But how to add this tex

2条回答
  •  清酒与你
    2021-02-20 04:07

    You can easly add text to youR elements creating a text Raphael element and add as attribute text into your element.

     elText = r.text(.....);
     yourEl.attr({text:elText});
    

提交回复
热议问题