Loesje
Posts: 1
Joined: Tue Feb 09, 2010 2:37 pm

Different tooltip-wrapping between versions 1.1.1 and 1.1.3

In version 1.1.3 the "white-space: nowrap" style is added to the Highcharts-tooltip div. This was not the case in version 1.1.1.

Why is this changed? I can not override it using:

tooltip: {
style: {'white-space': 'normal'}
},

And I need to because I have a very small graph, and sometimes the text in the tooltip is to large so that the tooltip is not showed completely. To fix that I've added

div.highcharts-tooltip {
width:50px;
}

to the css. So that the tooltip is always 50px wide. Now with version 1.1.1 the text was wrapped within the tooltip, but with version 1.1.3. it doesn't anymore.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Re: Different tooltip-wrapping between versions 1.1.1 and 1.1.3

The white-space style should be overrideable, you just have to use the JavaScript camelcase syntax instead of it's hyphenated CSS counterpart:

Code: Select all

tooltip: {
style: {whiteSpace: 'normal'}
}, 
Torstein Hønsi
CTO, Founder
Highsoft
elgreg
Posts: 2
Joined: Thu Feb 11, 2010 11:57 pm

Re: Different tooltip-wrapping between versions 1.1.1 and 1.1.3

Thanks for this. I was having the same issue and found that setting an explicit width on .highcharts-tooltip as well as the white-space: normal solved the problem.

Return to “Highcharts Usage”