Hello,

I am looking to display various pieces of data in chart form, using the 
google visualization API. Right now I have a line chart which draws the 
information to be displayed from a global array. I am trying to use a 
google visualization table to control which pieces of data are displayed. I 
have generated this table just fine, but when I want to "select" the pieces 
of data already shown to inform the user what is currently on the graph, 
there is no visual effect.

Here is the code in question:

                var theseSelections = []
var inner_index = 0;
for (var i = 0; i < chartArray[chartIndex].length; i++) { 
inner_index = chartArray[chartIndex][i];
if (start <= inner_index && inner_index <= end) {
theseSelections.push({row: inner_index - start, column: 0});
}
}
table.setSelection(theseSelections); 

var selection = table.getSelection();
for (var i = 0; i < selection.length; i++) {
var item = selection[i];
var message = ""
if (item.row != null && item.column != null) {
message += '{row:' + item.row + ',column:' + item.column + '}';
} else if (item.row != null) {
message += '{row:' + item.row + '}';
} else if (item.column != null) {
message += '{column:' + item.column + '}';
} 
if (message == '') {
message = 'nothing';
}
alert('You selected ' + message);
}


In short, it draws which fields are currently being displayed from 
chartArray[chartIndex], creates the JSON object for each piece of 
information and "selects" them all at once at the end. I have verified that 
the correct pieces of data are being selected with the second for loop. It 
displays that I have selected "{row: 1, column 0}, {row:4, column 0}, {row: 
5, column: 0}," so the correct pieces of data are selected, and the table 
returns these pieces of data as well, so I know the information is getting 
to the table properly. The table in question has 6 rows, and one column. I 
have also tried selecting column: 1 and column: null.

Regardless of what I do, there is no graphical indication that the table 
has any selections at all. You can recreate this in the google playground 
by calling setSelection() at the end of the table example. The 
setSelection() documentation clearly states that there should be a visual 
component to the function call, but I am not seeing any.

I could make a second column to display whether a row is selected but I 
would prefer to save the space in my application. Besides, the 
documentation clearly states that there should be a visual component to 
this method call. Is this a bug? Or am I missing something obvious?

Thanks for your help.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to