I have read almost all of the possibly related docs with regards to my question but could not get appropriate answer for it.
I am using google visualization api to draw the bar chart. I am creating a datatable and adding columns and rows for that datatable. Finaly using the draw api on chart object and passing the datatable and options array like the following:
var browser_options = {
width: 600,
height: 400,
legend: { position: 'top', maxLines: 3 },
bar: { groupWidth: '75%' },
isStacked: true,
};
My question, i read from some google documentation that i can group my bar charts using chbh parameters. Is there a way I can set these parameters using draw api?
How do i turn my horizontal bars into vertical? These must be some properties that i need to set on chart's data right?
Any help is appreciated. If there is any documentation for google chart's set properties on datatable, please point me to that doc.
Thanks a lot.
The chbh
property applies to the Image Chart API, not the Interactive Chart API. If you want to have vertical bars, you need to change your chart type from BarChart
to ColumnChart
, eg:
var myChart = new google.visualization.BarChart(document.querySelector('#chart_div'));
to:
var myChart = new google.visualization.ColumnChart(document.querySelector('#chart_div'));