'Google charts - delete gridline for first of month
Same issue with scattercharts and linecharts. Have a working chart, vAxis - sensor readings, hAxis - datetime. Chart shows daily readings for the last eight weeks - works.
And what it looks like, unwanted gridlines for the first of the month:

I have hAxis gridlines set up to display every 7 days - that works, but in addition to the weekly gridlines, google charts insists on displaying gridlines for the first of the month. Tried every permutation of gridlines count and minor gridlines I can think of. The only success I have had is gridlines color none, but that turns off all hAxis gridlines.
How can I turn off the gridlines showing for the 1st of each month?
Relevant options:
var levelOptions = {
title: "Remaining",
width: 420, //column is 420 with padding 5px, but this gives a right
//margin the same as the left
height: 250,
// chart area needs to be less than 100% to make room for axis labels
chartArea: {width: '85%', height: '80%'},
titlePosition: 'in',
axisTitlesPosition: 'none',
titleTextStyle: {color: 'DimGray',
fontSize: 14,
bold: false},
curveType: 'function',
lineWidth: 2, //width of lines connecting points
pointsVisible: false,
vAxis: {minValue: 0, //no need for max value, calc automatically
gridlines: {color:'Gainsboro'},
baselineColor: 'DimGray',
baseline: 0},
//Gridlines: {count: 0}, does nothing
//minorGridlines: {count: 0}, gets rid of all gridlines except 1st of month
//but leaves the ticklabels there, so why does gridlines count = 0 not work
//gridlines: {color:'none',}, //this gets rid of all of them but
//adding back in minor grid colour does not put them back
hAxis: {ticks: ticklabels,
textStyle : {fontSize: 9},
gridlines: {count: 0,},
//minorgridlines: {color:'Gainsboro',},
//gridlines: 0,
format: 'dd MMM', //so dates appear as, e.g. 1 Apr
baselineColor: 'DimGray',
baseline: data.getColumnRange(2).min},
legend: 'none',
};
ticklabels is an array of dates generated by parsing the arrayData and picking every 7th date.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
