figured it out...
had to add a "properties: {html: true}" object statement within the
setColumns method (in addition to the "tooltip: {isHtml: true}" property
added under options object. i had tried this with just the "p: {html:
true}" statement, but that failed.
kevin
On Thursday, January 2, 2014 5:15:41 PM UTC-5, kevin o'horan wrote:
> been banging my head against the wall trying to get active html in
> tooltips for column chart viz. but, all i'm getting is plain text. tried
> numerous permutations, based on searches in this forum (and elsewhere), but
> just can't seem to get this worked out. any help appreciated. code as
> follows...
>
> function useData1(response) {
> var data1 = response.getDataTable();
> var formatter1 = new google.visualization.DateFormat({pattern:
> "yyyy"});
> formatter1.format(data1, 0); // Apply formatter to first column.
> var formatter2 = new google.visualization.NumberFormat({pattern:'$
> #,###,###'});
> formatter2.format(data1, 2); // Apply formatter to second column.
> var view1 = new google.visualization.DataView(data1);
> view1.setColumns([0,2,{ // Create a view with two data cols, one
> calc'd col
> type:'string',
> calc: function (dt, row) {
> return "<div><b>Year:</b> " + dt.getFormattedValue(row,0) +
> "<br><b>Amount:</b> " + dt.getFormattedValue(row,2) + "</div>";
> },
> role: 'tooltip',
> }]);
> var optionsChart1 = {
> tooltip: {isHtml: true},
> dataOpacity:0.7,
> title: titleText,
> vAxis: {
> title: 'Document stamp losses ($)',
> textStyle: {
> fontSize: 10
> }
> },
> hAxis: {
> title: 'Year',
> titleTextStyle: {
> bold: true
> },
> slantedTextAngle: 33,
> textStyle: {
> fontSize: 10
> }
> },
> legend: {position: "none" },
> focusTarget: 'cell',
> chartArea: {
> width:"80%"
> }
> };
> var chart1 = new
> google.visualization.ColumnChart(document.getElementById('colChart1'));
> chart1.draw(view1, optionsChart1);
> }
>
>
> thanks,
> kevin
>
--
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.