Got a general question regarding the title element in a D3 chart.
The title is actually the roll over (tool tip) element in a chart. The below snippit of code will produce a 5 line roll over.
.append("svg:title").html(function(d) {return d.name+'\n Budget Amount : '+ numberWithCommas(d.budgetAmount)+'\n Actual Amount : '+numberWithCommas(d.actualAmount)+'\n Variance : '+numberWithCommas(d.variance)+'\n Variance to Budget: '+d.varianceToBudget.toFixed(0)+'%'});
This code work fine in Chrome, however does not work at all in IE. To get this to work in IE, I need to change .html to .text
Once I do this I can see the tool tip, problem is IE ignores the \n designed to cause a new line. The text only wraps when it gets to the end of the container.
I there a nice way to get IE to wrap text in a title element.
There are a lot of discussions on this and as to how IE decides to handle it in the end, especially with the older non-Edge versions.
Might be a better approach for now to research on handling it differently, i.e. via mousetip/mouseover events, d3-tooltips, nvd3-tooltips, etc. which should be able to give you the flexibility you need.