To make the tooltips work, you need to use a custom HTML tooltip column 
(one for each data series).  You can use a DataView to construct these 
dynamically:

// assumes two data series (columns 1 and 2)
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, {
    type: 'string',
    role: 'tooltip',
    properties: {html: true},
    calc: function (dt, row) {
        return '<div class="tooltip"><span class="tooltipLabel">' + 
dt.getFormattedValue(row, 0) + '</span>' + '<br /><span 
class="tooltipValue">' + dt.getColumnLabel(1) + ': ' + 
dt.getFormattedValue(row, 1) + '</span></div>';
    }
}, 2, {
    type: 'string',
    role: 'tooltip',
    properties: {html: true},
    calc: function (dt, row) {
        return '<div class="tooltip"><span class="tooltipLabel">' + 
dt.getFormattedValue(row, 0) + '</span>' + '<br /><span 
class="tooltipValue">' + dt.getColumnLabel(2) + ': ' + 
dt.getFormattedValue(row, 2) + '</span></div>';
    }
}]);

Then set the chart's tooltip.isHtml option to "true" and draw the chart 
using the view:

    // Create and draw the visualization.
var chart = new 
google.visualization.BarChart(document.querySelector('#chart_div'));
chart.draw(view, {
    width: 600,
    height: 400,
    tooltip: {
        isHtml: true
    }
});

Example: http://jsfiddle.net/asgallant/79AkR/

As far as I am aware, the axis labels do not support HTML, so if you got it 
to work, I'd like to see what you did.

On Friday, April 4, 2014 7:28:34 AM UTC-4, min ji wrote:
>
> I use the bar chart.  I replace the white spaces with the &nbsp; . For 
> the axis labels the browser can change the &nbsp; into space. But for 
> tooltips, it still shows "&nbsp;". How to fix it?
> Thank you.
>
> On Thursday, April 3, 2014 5:29:58 PM UTC+2, asgallant wrote:
>>
>> Which visualization(s) are you using?  Where does the whitespace appear 
>> (axis labels, tooltips, etc)?
>>
>> On Thursday, April 3, 2014 9:02:44 AM UTC-4, min ji wrote:
>>>
>>> Hello,
>>> I have a set of data. Some of them contains continuous white spaces. The 
>>> firefox will integrate continuous white spaces into one spaces. I try 
>>> to replace the white spaces with the &nbsp; but it doesn't work. how can I 
>>> visualize these spaces?
>>> Thank you,
>>> Min JI
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to