I must be missing something obvious, but I can't get the <text>
to show up. See http://jsfiddle.net/ydaLh/ for HTML + CSS
<svg style="width: 320px; height: 200px; top: 0px; left: 0px; position: relative;">
<g class="depth">
<g class="children">
<rect class="child" x="99" y="0" width="47" height="30">
<text dy=".75em" x="105" y="6">PRIMARY</text>
</rect>
<rect class="child" x="90" y="0" width="8" height="30">
<text dy=".75em" x="96" y="6">MASTER</text>
</rect>
<rect class="parent" x="90" y="0" width="56" height="30"></rect>
</g>
</g>
</svg>
Based on http://bost.ocks.org/mike/treemap/
In SVG you don't nest text elements within graphical elements, you must have something similar to:
svg
.append("rect")
.append("text");
But you actually need:
svg.append("rect");
svg.append("text");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With