Gauge font size

1,767 views
Skip to first unread message

paul291

unread,
Aug 22, 2011, 6:33:42 PM8/22/11
to Google Visualization API
It seems like there's currently no parameter for setting the font size
on gauge charts.

Is it possible to reveal how the font sizes are determined/can be
influenced?
The reason I ask is because I'm running into some trouble with the
gauge charts using font sizes that are way to big (going out of the
containing div).

Thanks.

fear209

unread,
Aug 22, 2011, 8:04:52 PM8/22/11
to google-visua...@googlegroups.com
yep had the same problem too .. 8 characters seems the limit of what it will scale correctly

NA

unread,
Aug 23, 2011, 7:51:31 AM8/23/11
to Google Visualization API
You might be able to inspect the markup around the chart to find out
if you can apply some css to the appropriate class or selector to
change it. It's messy, but it might be a suitable workaround until
this is something the API allows you to do.

asgallant

unread,
Aug 23, 2011, 9:40:30 AM8/23/11
to google-visua...@googlegroups.com
I've looked into doing that sort of thing (digging into the chart SVG code to find and modify particular elements) and it's not pretty.  I've yet to find any method that works consistently across more than one type of chart, and often times it's hard to make the same method work for two different charts of the same type.  It's doable if you know exactly what you are looking for (examining the SVG code in something like the Google Chrome developer console helps a great deal in this regard).  Using jQuery to access the contents of the iframe and SVG also helps immensely.

NA

unread,
Aug 23, 2011, 10:09:18 AM8/23/11
to Google Visualization API
I must admit, I got the idea from an earlier tip you had given me :)

It is super messy. A great future enhancement would be to provide a
css API for styling the gauges, charts, etc. That'd be very helpful.


Reply all
Reply to author
Forward
0 new messages