Yes, there is no way to specify a background for the text, here's how to create a rectangle that will serve as the background:
var text = canvas.text(px, py, poly.title).attr(textAttr); var box = text.getBBox(); var rect = canvas.rect(box.x, box.y, box.width, box.height).attr('fill', 'black'); text.toFront();
source share