In GoJS one can create a border by using an “Auto” Panel with a Shape. I am guessing that you don’t need a border line, so you would set Shape.strokeWidth to zero. You would set the Shape.fill to be the “lightblue” color that you are trying to draw behind the text. And you would set the TextBlock.margin to control the amount of space beyond the text’s rectangular area. The panel sizes the shape to surround the text, including its margin.