How do you remove the x-axis from a bar chart produced by Google's Visualization API?

Dan picture Dan · Apr 7, 2009 · Viewed 48.8k times · Source

Referring to the kind of chart shown here: http://code.google.com/apis/visualization/documentation/gallery/barchart.html

There doesn't seem to be a simple switch, and changing the axis color to white (on a white background) didn't seem to do anything. I even tried jquery to hide the selectors produced by the api output but no dice.

Answer

Dan Diplo picture Dan Diplo · Feb 7, 2013

You can set hAxis.textPosition to the value of 'none'

For example:

var options = {

                hAxis: { textPosition: 'none' },
            };

chart.draw(data, options);

See https://developers.google.com/chart/interactive/docs/gallery/barchart#Configuration_Options