There was another question about this recently: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/google-visualization-api/X6Mad7NCCPU/GKD-kQ3LGAAJ I made this example to show how it can be done: http://jsfiddle.net/dlaliberte/f7r3odo7/
On Fri, Mar 11, 2016 at 2:10 AM, Vishal Madhvani <[email protected]> wrote: > Hey all, > > I need a stacked multi series bar chart for a project i'm working on and I > can't seem to figure out if its possible using Google Charts. > The project use Material Design styling and Google Charts is awesome, so > this would be ideal over a custom solution. > > Here's a JSFiddle of the Material Design example from the google docs. > https://jsfiddle.net/gvm0p62d/ > It has 3 bars (series) per year; sales, expenses and profit. > I would like to add another dimension and make these bars to be stackable. > > The data format from the example is : > > var data = google.visualization.arrayToDataTable([ > ['Year', 'Sales', 'Expenses', 'Profit'], > ['2014', 1000, 400, 200], > ['2015', 1170, 460, 250], > ['2016', 660, 1120, 300], > ['2017', 1030, 540, 350] > ]); > > > The data format i'm thinking would look something like: > > var data = google.visualization.arrayToDataTable([ > ['Year', 'Sales', 'Expenses', 'Profit'], > ['2014', [1000, 1000, 1000], [400, 400, 400], [200, 200, 200]], > ['2015', [1170, 1170, 1170], [460, 460, 460], [250, 250, 250]], > ['2016', [660, 660, 660], [1120, 1120, 1120], [300, 300, 300]], > ['2017', [1030, 1030, 1030], [540, 540, 540], [350, 350, 350]] > ]); > > > > I guess the main question is, is this possible with the current api's? > I'm thinking not, so I may need to build a new chart type. Can I build on > top of the existing chart? Or do I need to start from scratch? > > Any ideas or advice would really be appreciated. > > Thanks > > > > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to > [email protected]. > Visit this group at > https://groups.google.com/group/google-visualization-api. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-visualization-api/65417b31-5c0b-41e0-b0ef-4107460bb5b6%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/65417b31-5c0b-41e0-b0ef-4107460bb5b6%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJNdsPKNCyDYecCUR-Q4QhwHjPQoHeXyc6jMhNix_%3DQTkw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
