Is your BarChart drawn with the same DataTable as your Table chart? Sorting a DataTable moves the rows, so if you draw a BarChart with a given DataTable and subsequently sort the DataTable, the selection event no longer returns meaningful indexes into the DataTable (I think). If you want to preserve some kind of correspondence, you need to implement it yourself. A first step might be to use two copies of the DataTable for each chart. Then, when the Table chart's DataTable is sorted, you can inspect the values in the selected row and use those values to find a row in the BarChart's DataTable.
On Mon, Jul 19, 2010 at 11:50 PM, Student <[email protected]> wrote: > this is what i do..... > > google.visualization.events.addListener(table, 'select', > function() { > var item = table.getSelection()[0]; > chart.setSelection([{row:item.row, column:1}]); > }); > > google.visualization.events.addListener(chart, 'select', > function() { > var item = chart.getSelection()[0]; > table.setSelection([{row:item.row, column:null}]); > }); > > google.visualization.events.addListener(table, 'sort', > function(event) { > data.sort([{column: event.column, desc: !event.ascending}]); > chart.draw(data, null); > }); > > > i also checked what text data we get after sorting in table... it > gives incorrect results.... > What is incorrect about the results? > > On Jul 19, 4:44 pm, Student <[email protected]> wrote: > > When i use getselect to select between barchart & table and vice versa > > it works fine, but when i sort it according to table and then > > getselect the indexing is lost and hence displays wrong result on > > getselect after sorting. > > The key are not moving with the data sorted. > > Perhaps google viz team should also maintain a separate index column > > internally to manage that or am I doing something wrong? > > Need guidance > > > > regards > > Akku > > -- > 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.
