Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chart Background Color

I'm styling a google chart using the javascript api. I want to change the background of the area where the data is plotted. For some reason when I set background options like so:

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

It changes the the background of the whole chart and not the area where the data is plotted. Any ideas on how to only change the background of the plotted area? Thanks

like image 513
firebait Avatar asked Jan 10 '12 18:01

firebait


People also ask

How do you change the background of a chart in Google Sheets?

Click the Chart style arrow to display the options. Set the color of the chart area. Click Background color. Pick an option.


2 Answers

pass the options like this

var options = {     title: 'title',     width: 310,     height: 260,     backgroundColor: '#E4E4E4',     is3D: true }; 
like image 144
uma shankar pandey Avatar answered Sep 30 '22 00:09

uma shankar pandey


add this to your options:

'chartArea': {     'backgroundColor': {         'fill': '#F4F4F4',         'opacity': 100      },  } 
like image 44
Kris Lamote Avatar answered Sep 29 '22 22:09

Kris Lamote