Diverging Stacked Bar Chart

1,450 views
Skip to first unread message

Pavan Chokshi

unread,
Aug 3, 2016, 2:39:09 PM8/3/16
to Google Visualization API
Hi,

I need to make diverging stacked bar chart using Google Charts similar to the chart at the below link:


Is there any way to create such chart using Google Bar Chart ?

Thank you,
Pavan

Daniel LaLiberte

unread,
Aug 3, 2016, 3:02:40 PM8/3/16
to Google Visualization API
Hi Paven,

There is no direct way to draw that type of chart, but you could implement it using a stacked bar chart where you add a first series that is drawn invisibly to act as the spacer so the rest of the data is plotted as expected.  You'd have to compute the value of the spacer as: (the minimum of all the other data) - 1 (or -100%).

--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
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/3185dc77-d01a-4447-95f9-42a657357299%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Pavan Chokshi

unread,
Aug 3, 2016, 5:35:25 PM8/3/16
to Google Visualization API
Hi Daniel,

Thank you for the wonderful idea. It worked well !


On Wednesday, August 3, 2016 at 12:02:40 PM UTC-7, Daniel LaLiberte wrote:
Hi Paven,

There is no direct way to draw that type of chart, but you could implement it using a stacked bar chart where you add a first series that is drawn invisibly to act as the spacer so the rest of the data is plotted as expected.  You'd have to compute the value of the spacer as: (the minimum of all the other data) - 1 (or -100%).
On Wed, Aug 3, 2016 at 2:39 PM, Pavan Chokshi <pavan....@sjsu.edu> wrote:
Hi,

I need to make diverging stacked bar chart using Google Charts similar to the chart at the below link:


Is there any way to create such chart using Google Bar Chart ?

Thank you,
Pavan

--
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 google-visualization-api+unsub...@googlegroups.com.



--

Bob Harper

unread,
Oct 21, 2016, 11:15:59 AM10/21/16
to Google Visualization API, pavan....@sjsu.edu
Hi Pavan, Daniel

I'm also interesting in creating divergent bar charts (to show results of opinion surveys). I tried to create the invisible spacer but I'm not quite sure how to do that. Can you share any code or even a link to where it is described?
Thanks
Bob
Reply all
Reply to author
Forward
0 new messages