I'm trying to produce a vertically stacked bar chart using the Google Charts API and I thought I had found the solution when I found the option:
isStacked: true
However, This seems to add the stacking horizontally (see link below) and I cant seem to find a way to do it. Anyone come across this before or can help me?
See: http://jsfiddle.net/tmA55/1/
Thanks
If you want your bar charts to be vertical instead of horizontal, the alternative way to do that is by selecting the data, and choosing the Stacked Column option under the Column chart section. Excel will then again prepare the bar chart for you in the vertical direction like shown below.
Here's how to make a stacked bar graph in Google Sheets: Choose a dataset and include the headers. Press 'Insert Chart' in the toolbar. Click 'Setup' and change the chart type to 'Stacked Bar Chart' in the 'Chart Editor' panel.
Do you mean a vertically stacked ColumnChart?
Just change the chart from BarChart
to ColumnChart
:
new google.visualization.ColumnChart(document.getElementById('chart'))
http://jsfiddle.net/asgallant/tmA55/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With