This example has text inside the boxes. I use svg&#x27;s .getBBox() to obtain width&#x2F;height for each label.<p><a href="http:&#x2F;&#x2F;twitter.github.io&#x2F;labella.js&#x2F;with_text.html" rel="nofollow">http:&#x2F;&#x2F;twitter.github.io&#x2F;labella.js&#x2F;with_text.html</a><p>The max width parameter is optional. I am not sure what are you trying to do with the graphs though. This library is not for graphs or trees. It&#x27;s for points on single axis.