I've used this Example for creating the organization chart. >> d3.js v3 (old version)
Need help with the "position" content, this is the code line for the position content:
nodeGroup.append("text")
.attr("x", dynamic.nodeTextLeftMargin)
.attr("y", dynamic.nodePositionNameTopMargin)
.attr('class', 'emp-position-name')
.attr("dy", ".35em")
.attr("text-anchor", "left")
.text(function(d) {
var position = d.positionName.substring(0,27);
if(position.length<d.positionName.length){
position = position.substring(0,24)+'...'
}
return position;
});
<text x="75.14285714285714" y="32.5" class="emp-position-name" dy=".35em" text-anchor="left">Business Development Manager</text>
I don't want to display text like Business Development Man...
So, either I want to add a tooltip on hover (Business Development Man...) or make it happens to wrap or break long text/word in a fixed width.
I tried to modify the below CSS but no helps.
.node-group .emp-position-name {
fill: black;
font-size: 11px;
word-wrap: break-word;
}
Would appreciate some guidance on how I can resolve this.