the trick is to use "final" references to the data table and the
visualization, like this:
void addSelectHandler(final PieChart chart, final AbstractDataTable
dataTable) {
chart.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
String label =
dataTable.getColumnLabel(chart.getSelections()[0].getColumn());
doSomethingWithColumnLabel(label);
}
});
}
On Tue, Feb 16, 2010 at 6:25 AM, carlos <[email protected]> wrote:
> I'm constructing a google visualization with the google web toolkit.
>
> I am working off of this example and trying to add a selection
> handeler:
> http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted
>
> In the example when you select a cell it displays the row and column
> numbers. I would like to display the column's label instead of the
> row and column numbers. Is there an easy way to access the selection
> cell's column label from the selection handler? Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-visualization-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.