How can I dynamically add/remove a column to an already loaded
datatable? I am trying to build a Cancel/Delete option for every
items shown in the LineChart.
In other word, in the LineChart Category, if you click on each
category, the line item will blink in the chart. I want to be able to
delete that line item instead.
I tried to register a SelectHandler which is able to update/remove
column from the datatable, however the change won't be reflected in
the chart (Guess re-rendering is needed ?!).
I added the following to the SelectionDemo with no success. Is there
any way to fire an event on the client side to re-render the Viz?
SelectionDemo(Selectable viz, Label label, DataTable data) {
this.viz = viz;
this.label = label;
this.data = data; <<<<================
}
@Override
public void onSelect(SelectEvent event) {
StringBuffer b = new StringBuffer();
JsArray<Selection> s = getSelections();
for (int i = 0; i < s.length(); ++i) {
if (s.get(i).isCell()) {
b.append(" cell ");
b.append(s.get(i).getRow());
b.append(":");
b.append(s.get(i).getColumn());
// remove the row
} else if (s.get(i).isRow()) {
b.append(" row ");
b.append(s.get(i).getRow());
} else {
b.append(" column ");
b.append(s.get(i).getColumn());
data.removeColumn(s.get(i).getColumn());
<<<<<<======================
}
}
label.setText("selection changed " + b.toString());
}
--
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.