Minor gridlines not showing

383 views
Skip to first unread message

Mark Jones

unread,
Dec 30, 2019, 12:05:40 PM12/30/19
to Google Visualization API
I'm using the sample code for drawing a linear line graph, which works pretty well. But, I can't get minor gridlines to work, which I'd like to be on every frequency between 5, 10, 15, etc, in other words on 1, 2, 3, 4...6, 7, 8, 9...

      var linearOptions = {
        title: 'Power by frequency linear spectrum',
curveType: 'none',
        legend: 'none',
        width: 600,
        height: 300,
        hAxis: {
          title: 'Frequency(Hz)',
  ticks: [0, 5, 10, 15, 20, 25, 30],
  gridlines: {
color: '#C0C0C0'
  },
  minorGridlines: {
color: '#e6f7ff'  
  }
        },
        vAxis: {
          title: 'Power(uV^2)',
  gridlines: {
color: '#C0C0C0'
  },
  minorGridlines: {
color: '#e6f7ff'  
  }
        }
  }



2019-12-30_11-02-33.jpg


Hartmut Gunther

unread,
Dec 30, 2019, 11:33:54 PM12/30/19
to Google Visualization API
I have the same problem

Hartmut Gunther

unread,
Jan 6, 2020, 9:05:24 PM1/6/20
to Google Visualization API
Hi Mark.
Have you been able to resolve this. I have not

regards

Hartmut


On Tuesday, 31 December 2019 04:05:40 UTC+11, Mark Jones wrote:

Steven Lovell

unread,
Jan 7, 2020, 5:43:54 AM1/7/20
to Google Visualization API
Hi Mark,



"ticks" : [ ARRAY OF NUMBERS ],
//Replaces the automatically generated X-axis ticks with the specified array.

I've had a play around and found that using "ticks" will override your Gridlines and MinorGridlines.

It's probably not the format you want but this is the best I can come up with. Ive reduced the font size and increased the width so you can see the results of the hAxis


      var linearOptions = {
        title: 'Power by frequency linear spectrum',
            curveType: 'none',
        legend: 'none',
        width: 800,
        height: 300,
        hAxis: {
              gridlines: {
              color: '#C0C0C0', count : 30

            },
               minorGridlines: {
                color: '#e6f7ff'
            },
          textStyle : {
                    fontSize : 8
                },
          title: 'Frequency(Hz)',
        //      ticks: [0, 5, 10, 15, 20, 25, 30],

        },
        vAxis: {
          title: 'Power(uV^2)',
              gridlines: {
                color: '#C0C0C0'
            },
              minorGridlines: {
                color: '#e6f7ff'
          }
        }
      }



Regards,
Steve.



Mark Jones

unread,
Jan 7, 2020, 9:18:47 PM1/7/20
to google-visua...@googlegroups.com
Steven,

Thanks for tinkering with it! At least I know the ticks overrides the gridline objects.

Mark

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/8ecd8e2b-0b55-45cc-a7bb-484c478a72f6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages