[visualization-api] Table visualization with cell selection

240 views
Skip to first unread message

Renato Beserra

unread,
Jan 12, 2012, 7:07:55 AM1/12/12
to Google Visualization API
Hi, I noticed that the Table visualization doesn't have a cell selection policy.

Anybody knows why?

Is there any known workaround to enable it?

Thanks!

--
Renato Beserra Sousa

asgallant

unread,
Jan 12, 2012, 11:32:12 AM1/12/12
to google-visua...@googlegroups.com
You can use regular js event listeners on the table's 'td' elements to get the column index.  Here's an example (with a bit of help from jQuery): http://jsfiddle.net/2Vtwb/

Renato Beserra

unread,
Jan 12, 2012, 11:41:16 AM1/12/12
to google-visua...@googlegroups.com
Thanks for the answer.

Do you know if I can disable the select event of the table? I will have to override the css style to show the cell selection policy and the row selection can be a problem.

2012/1/12 asgallant <drew_g...@abtassoc.com>
You can use regular js event listeners on the table's 'td' elements to get the column index.  Here's an example (with a bit of help from jQuery): http://jsfiddle.net/2Vtwb/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/pX-n-1fS95wJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
Renato Beserra Sousa

asgallant

unread,
Jan 12, 2012, 11:55:44 AM1/12/12
to google-visua...@googlegroups.com
You can override the existing css by using the cssClassNames option: http://code.google.com/apis/chart/interactive/docs/gallery/table.html#Configuration_Options

I have a vague recollection that there used to be an option to disable interactivity in the charts, though I can't seem to find it for the tables.  If you do find a way to disable the selection event, you'll have to use standard js to grab the row index too, but that's not difficult: http://jsfiddle.net/2Vtwb/1/

Renato Beserra

unread,
Jan 12, 2012, 12:01:50 PM1/12/12
to google-visua...@googlegroups.com
Thank you very much! If I find something else useful I will share later.

2012/1/12 asgallant <drew_g...@abtassoc.com>
You can override the existing css by using the cssClassNames option: http://code.google.com/apis/chart/interactive/docs/gallery/table.html#Configuration_Options

I have a vague recollection that there used to be an option to disable interactivity in the charts, though I can't seem to find it for the tables.  If you do find a way to disable the selection event, you'll have to use standard js to grab the row index too, but that's not difficult: http://jsfiddle.net/2Vtwb/1/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
Renato Beserra Sousa

NA

unread,
Jan 16, 2012, 6:47:53 PM1/16/12
to Google Visualization API
Now I'm curious - is there a reason the Table chart doesn't implement
identify which column was clicked on? Is this something that's more
complicated than I imagine, or are there some situations where this
becomes difficult?

Since the Table provides a listener that tells us what row was clicked
on, it'd be nice if it did the same for columns. If we can code this
ourselves in js, seems like we can code the same for the Google class
once so that everyone can use it. If someone has a good listener
codes, perhaps it can be posted so the GVIZ team can incorporate it
into the codebase?

asgallant - when I first saw you mention using regular js, I was
surprised that you didn't mention jQuery. I was greatly relieved when
I read your second sentence ;) (kiddding - I've learned a lot from
your posts showing how to use jQuery in conjunction with the GVIZ
API. It has made jQuery that much more useful for me).

Jinji

unread,
Jan 17, 2012, 5:50:47 AM1/17/12
to google-visua...@googlegroups.com
You're right that the Table visualization doesn't support column selection, only row selection. Since augmenting the Table visualization is not high on our priority list, I can't promise it happening any time soon...

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
Reply all
Reply to author
Forward
0 new messages