I have legend of a chart like this with svg:
<g class="legend">
<g class="scrollbox">
<g><text>aaa</text></g>
<g><text>bbb</text></g>
<g><text>ccc</text></g>
<g><text>ddd</text></g>
<g><text>eee</text></g>
</g>
</g>
this would good if each text is not really long, but if text is long, it make legend(g) unnecessary bigger.
So I want legend (g) to have fixed width, and if text inside it is long, I want it to be wrapped.
How can I achieve this?
I know that I cannot really give style to <g>
, so append some elements inside legend to achieve this?