Oooh, you gave me a good idea for this. This will get rid of the category
label from the tooltip (though the tooltip box is now a bit awkwardly large
- changing that would require quite a bit more work). You'll need jQuery to
make it work:
/* assumes:
* chart is the chart object to draw
* 'visualization' is the name of the chart's div
* hooks the onMouseOver function to the chart's iframe body
* finds the 3rd-to-last text element (the category column label in the
tooltip)
* and sets it to an empty string
* fires on every sub-element in the chart, so the tooltip never shows the
label
*
* call this after instantiating the chart object but before drawing the
chart
*/
google.visualization.events.addListener(chart, 'ready', function() {
$('#visualization').find('iframe').contents().find('body').mouseenter(
function() {
$(this).find('text').last().prev().prev().text('');
});
});
You can take this further to change the rest of the tooltip. The last text
element contains the value to display and the 2nd-to-last text element
contains the column label.
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/D9sSQXbFuTQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.