Change the background colour of a Raphael "Label"

If I create a [`Label`][1] using Raphael, the default style is a black block with white text. How can I change the background box colour, but not the text colour? I've tried: paper.label(x, y, value).attr("fill", colour) but that also fills the text and I end up with invisible text. I also can't simply change the default colour in [this function][2] because I need to have a few different ones depending on a line that it's added to: ![enter image description here][3] [1]: http://g.raphaeljs.com/reference.html#Element.label [2]: https://github.com/DmitryBaranovskiy/g.raphael/blob/master/g.raphael.js#L328 [3]: http://i.stack.imgur.com/km8ja.png

以上就是Change the background colour of a Raphael "Label"的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏