In order to use the custom tooltips, you have to set the proper column role
for the tooltip column. Given your code as-is, add these lines after
creating the DataTable but before drawing the chart:
data.setColumnProperty(4, 'role', 'tooltip');
data.setColumnProperty(4, 'html', true);
On Sunday, November 10, 2013 5:42:50 PM UTC-5, Tim Johnson wrote:
>
> I paste this into the Playground and I get raw text "<div>my text</div>",
> not the HTML version I was expecting. What am I doing wrong?
>
> function drawVisualization() {
> // Create and populate the data table.
> var data = google.visualization.arrayToDataTable([
> ['Year', 'Austria', 'Bulgaria', 'Denmark', 'Tooltip'],
> ['2003', 1400360, 1400361, 1400362, '<div>THIS IS IT</div>'],
> ]);
>
> data.setColumnProperty(4, 'role', 'tooltip');
> data.setColumnProperty(4, 'p', {'html': true});
>
> // Create and draw the visualization.
> new google.visualization.ColumnChart(document.getElementById(
> 'visualization')).
> draw(data,
> {title:"Yearly Coffee Consumption by Country",
> tooltip: {isHtml: true},
> width:600, height:400, legend:{position: "none"},
> vAxis: {title: "Year"},
> hAxis: {title: "Cups"}}
> );
> }
>
--
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/groups/opt_out.