Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Stacked bar charts (Grouped and Stacked at the same time) #1270

Closed
orwant opened this issue May 9, 2015 · 10 comments
Closed

Multiple Stacked bar charts (Grouped and Stacked at the same time) #1270

orwant opened this issue May 9, 2015 · 10 comments

Comments

@orwant
Copy link
Collaborator

orwant commented May 9, 2015

What would you like to see us add to this API?
I think it's actually essential to have this feature in the column charts. Think of
a case where two similar data sets are to be displayed on the same chart for comparison
purposes, at the moment this is not possible. 

Going from the example given on the Code Playground for column charts, think of the
case if two types of coffees were to be displayed for each country: ground coffee and
instant. Having the columns for each of the countries divided into two sections would
allow instant comparison between the number of cups of each type of coffee in each
year.


What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
ColumnChart, BarChart, DataTable

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by jahidturkmen on 2013-07-30 07:41:13

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

yes, I was really looking for a solution to this.

To be more specific, I would like to have a graph with two data sets grouped by date
for example. For each date - one would be stacked, and the other would be flat.

Thanks

Original issue reported on code.google.com by shmul@simchony.com on 2014-10-30 10:07:33

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

This is actually possible with the new Material Bar chart (albeit in a somewhat roundabout
way). In the new chart, if you make a chart stacked, but place some series on a different
axis, that creates a separate stack for those series. Unfortunately, there is currently
no way to completely hide an axis yet, and you will have to explicitly set the view
window. Eventually we will introduce options to hide axes and to align view windows,
but this will have to do for now.

Original issue reported on code.google.com by grabks@google.com on 2014-10-30 14:49:17

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Here is a jsfiddle example of that: http://jsfiddle.net/p7o0pjgg/

Original issue reported on code.google.com by grabks@google.com on 2014-10-30 14:49:30

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

I did it! Thanks :)
http://jsfiddle.net/qv325979/

I spent few hours trying to change the colors of the stacked bars and couldn't figure
this out.
Any idea?

Thanks!

Original issue reported on code.google.com by shmul@simchony.com on 2014-10-30 17:00:30

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

The jsfiddle example is great, but the legend is not working well. I can't set its position.
And when the items in the legend are too many, they are not displayed as expected because
the container cut them off.

Thank you!

Original issue reported on code.google.com by micmia128 on 2015-01-19 17:09:22

@grabks grabks closed this as completed Jan 13, 2016
@ansgarbecker
Copy link

ansgarbecker commented Dec 30, 2016

Is there still no way to hide an axis? That's the only issue left for getting pretty stacked multiple data sets.
Setting vAxis.textPosition to none does not do anything in that case, which is also what @grabks stated above:

Unfortunately, there is currently no way to completely hide an axis yet, and you will have to explicitly set the view window. Eventually we will introduce options to hide axes and to align view windows, but this will have to do for now.

@dmak
Copy link

dmak commented Feb 13, 2017

I failed to make the feature of grouped stacked bars to work with combi-chart (see fiddler). What do I miss? The solutions I found (here and there) solve it for bar chart using targetAxisIndex.

Apparently found relative issue #1444.

@dlaliberte
Copy link
Collaborator

dlaliberte commented Feb 13, 2017 via email

@MichaelSchober
Copy link

Unfortunately I couldn't find a good way to do this in a nice way either.

You can accomplish something similar tough using the normal ColumnChart with some empty columns. I ended up using this solution from Stackoverflow( jsfiddle )

@dearsina
Copy link

dearsina commented May 4, 2019

@MichaelSchober, your linked solution is so hacky, but it works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants