Customizing Google Chart Gridline Color Graphics

I am trying to set the color of the grid lines against the background of my graph using Google graphs.

I have this code to configure chart parameters:

ac.draw(activityData, { title : 'Monthly Coffee Production by Country', isStacked: true, width: 600, height: 400, fontSize: 0, backgroundColor: '#1E4D6B', hAxis.gridlines.color: '#1E4D6B' }); 

However, I don’t know how to use options like hAxis.gridlines.color in my code that appear on the options page.

If I just put hAxis.gridlines.color , it causes an error in the console:

Untrained SyntaxError: Unexpected token.

What is the correct syntax for using options containing periods?

+6
source share
1 answer

This is a litteral object that you pass as the second draw () parameter, so I assume that it should be:

hAxis: {gridlines: {color: '#1E4D6B'}}

+11
source

Source: https://habr.com/ru/post/917454/


All Articles