Here I am again,

I am implementing a Combochart, and I want to set a tooltip using the 
functionality by HTML. This is my code :


var data2 = new google.visualization.DataTable();
data2.addColumn('number', 'Year');
data2.addColumn('number', 'Amount');
// A column for custom tooltip content
// data2.addColumn({type: 'string', role: 'tooltip'});
// Use custom HTML content for the domain tooltip.
data2.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': 
true}}); for (var i=0; i < ret.length; i++) 
{ 
if(parseFloat(ret[i]) != 0){ 
//alert(getAmount(parseFloat(window.result[i][0]), data2)); 
data2.addRow( [parseFloat(ret[i]), 
getAmount(parseFloat(ret[i])), 
createCustomHTMLContent(ret[i]) ] ); 
} 
} 
var options2 = { 
// This line makes the entire category's tooltip active. 
focusTarget: 'category', 
// Use the new HTML tooltip (default SVG one does not support HTML 
content). 
tooltip: { isHtml: true }, 
title : 'Monthly asd Production by Country', 
//vAxis: {title: "asd"}, 
hAxis: {title: "Year"}, 
seriesType: "bars", 
}; 
window.chart.draw(data2,options2); 
//google.visualization.events.addListe
function createCustomHTMLContent(date) { 
return '<div style="padding:5px 5px 5px 5px;">' + 
date + 
'</div>'; 

}


But, when, on browser, the tooltip shows directly the entire HTML code and 
not the HTML formatted. Is there anyone who has already encountered this 
kind of problem ? I followed the official guide step by step!

Thank you.

Gabriele

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to