Google BarChart set width of bars?

Kenny Wyland picture Kenny Wyland · Jul 15, 2011 · Viewed 36.3k times · Source

I'm generating a BarChart with Google's javascript visualization libraries. I would like to make the bars in the chart to be wider than they currently are, but I can't find anything in the documentation which shows how to configure the width of the bars of each data set.

Any help?

Answer

Josh Rumbut picture Josh Rumbut · Jun 10, 2013

Had this same question, figured I'd post for posterity. The bar.groupWidth appears to be the way to set this.

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

For example:

 var options = {
        title: "Density of Precious Metals, in g/cm^3",
        width: 600,
        height: 400,
        bar: {groupWidth: "95%"},
        legend: { position: "none" },
      };
 var chart = new google.visualization.BarChart(document.getElementById("barchart_values"));
 chart.draw(view, options);