Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertically stacked Google Bar Charts

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

like image 598
MarkP Avatar asked Nov 22 '13 14:11

MarkP


People also ask

How do I create a vertical stacked bar chart?

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.

Can you do a stacked bar chart in Google Sheets?

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.


1 Answers

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/

like image 152
asgallant Avatar answered Nov 15 '22 08:11

asgallant