Column Chart remove bars that have zero value

1,145 views
Skip to first unread message

Rastko Jokic

unread,
Jan 29, 2013, 6:54:27 AM1/29/13
to google-visua...@googlegroups.com
So, I want to remove bar from the column chart that has value zero so it doesn't take any space on the h-axis. Chart is not stacked.

I wasn't able to find anything like that in API. Anyone has any ideas?

Thank you in advance!

Michelle Stewart

unread,
Jan 29, 2013, 9:10:46 AM1/29/13
to google-visua...@googlegroups.com
In my experience that would have a lot to do with how you are pulling in your data.  If you are using a query you could add something to the where clause like > 0 or not = 0.  If you are building the table client-side with addColumn/addRows then you could add an if to see if it's 0 before adding the row.  That is how I would approach it at least.  A code sample would help us get you a more precise solution though.

Rastko Jokic

unread,
Jan 29, 2013, 9:50:10 AM1/29/13
to google-visua...@googlegroups.com
That was my first idea but it not feasible since I only need one bar to have this property... I am thinking maybe another approach... Do you know, is it possible to set specific row in the dataTable to be stacked - that way the zero value wouldn't be visible?


--
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 http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Best,

Rastko Jokić

Michelle Stewart

unread,
Jan 29, 2013, 10:01:14 AM1/29/13
to google-visua...@googlegroups.com
Can you give an example?  (code wise)?
Michelle Stewart
Nysus Solutions

asgallant

unread,
Jan 29, 2013, 12:09:13 PM1/29/13
to google-visua...@googlegroups.com
Do you have multiple data series per row, and one of these series has a zero in one row, which you would like hidden?  If so, this cannot be done.


On Tuesday, January 29, 2013 6:54:27 AM UTC-5, Rastko Jokic wrote:
Reply all
Reply to author
Forward
0 new messages