Ryan
Ryan

Reputation: 2660

Google Charts grid color

How do I change the color of the grid lines for Google Charts API?

Upvotes: 2

Views: 2772

Answers (1)

Nicodemuz
Nicodemuz

Reputation: 4144

From the documentation: http://code.google.com/apis/chart/docs/gallery/bar_charts.html#gcharts_grid_lines

This parameter doesn't let you specify the thickness or color of the lines. For more ways to make lines across your chart, see shape markers (chm type h, H, v, or V), range markers (chm), and axis tick marks (chxtc).

Thus you can have a look at what range markers (chm) are: http://code.google.com/apis/chart/docs/gallery/bar_charts.html#gcharts_range_markers

To answer your question, you need to use the chm parameter to draw each line separately. The second parameter defines the color:

chm=r,FF0000,0,0.499,0.501

The code above draws a horizontal line with color #FF0000 in the middle of the chart.

Upvotes: 5

Related Questions