how to change the background color of the gauge chart?

2,142 views
Skip to first unread message

Venkatapathi raju Ch

unread,
Jan 30, 2014, 1:34:44 AM1/30/14
to google-visua...@googlegroups.com
I'm styling a google chart using the javascript api. I want to change 
the background of the guaue chart background. For some reason 
when I set background options like so: 

chart.draw(data, { backgroundColor: { fill: "#F4F4F4" } }) 

my requirement is the background color gauge chart 
Any ideas on how to change the 
background color  of the gauge chart? 
Thanks 

asgallant

unread,
Jan 30, 2014, 10:47:32 AM1/30/14
to google-visua...@googlegroups.com
Gauges don't support changing the background color.  If you want to change the background color, you have to modify the SVG/VML code created by the API.  Here's an example that changes the SVG using jQuery: http://jsfiddle.net/asgallant/7CGhJ/

Note that this example does not work in IE 8 and older (as they use VML instead of SVG).  You need a separate code path to handle them.
Reply all
Reply to author
Forward
0 new messages