Reputation: 313
I have highchart like this.
How can I display the legend (Firefox,IE,chrome...) text in next row if the text is too long?
Image describing my problem is
P.S. I am not familiar with jQuery. Expecting a solution
Upvotes: 1
Views: 3788
Reputation: 4916
You will need to make use of a labelFormatter
labelFormatter: function()
{
var legendName = this.name;
var match = legendName.match(/.{1,10}/g);
return match.toString().replace(/\,/g,"<br/>");
}
I have made an edit to the fiddle and you can find it Here. It pushes the legend item text to next line after every 10 characters. Guess this is what you needed.
Hope this helps.
Upvotes: 4