Feature request: tooltips for axis values

15 views
Skip to first unread message

Suzanne Paley

unread,
Oct 17, 2016, 6:27:49 PM10/17/16
to Google Visualization API
I have a column chart with a discrete hAxis.  My hAxis category labels are abbreviated forms of a longer string, which I would like to show in a tooltip, but there doesn't seem to be any way to accomplish that.  I wouldn't even mind rolling my own tooltips, but it seems that no mouseover event is even triggered when I mouse over a category label.

Also (or perhaps alternatively), is there any way to force a linebreak in a category label?  I'm seeing longish labels overlapping even when I think they should be split over multiple lines, and I'm not sure how to prevent that.

Suzanne

Daniel LaLiberte

unread,
Oct 18, 2016, 10:52:57 AM10/18/16
to Google Visualization API
Hi Suzanne,

We don't have tooltips for axis labels, though we have though about adding support for that.  At best, you could use something like jQuery to attach event handlers to the generated text elements, but that sounds rather brittle.

Regarding tick labels with linebreaks, all you have to do is include a newline character in your label.  e.g. 'United\nStates'.  You can do this just for the formatted representation if you like:

  [{v: 'US', f: 'United\nStates'}, ...]

The newline character is converted into whitespace when the formatted representation is used in a tooltip.


--
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 google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5cb76857-21fd-463b-a186-40503141ee10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages