This example, using satirical data from The Onion, demonstrates how to wrap long axis labels to fit on multiple lines.
UPDATE: In order to make this code work for horizontal bar charts, the code for setting the 'y' attribute must be used when setting the 'x' attribute. I've included only the wrap function in this fork.
Could you please direct me to the link where i can find the above code in typescript? i am working with d3 v4 in angular2