Could you use the Table chart's built-in sorting capabilities?  I mean, you
probably have a good reason for setting options.sort = 'event' instead of
'enable', I'm just curious.

MC Get Vizzy

On Wed, Jul 21, 2010 at 5:23 PM, akshay dange <[email protected]> wrote:

> Thanks MC
> I tried doing it,
> But I call very large chunk of data and that too call it from servlet each
> time dynamically from db.
> Making two datatable will make processesing heavy and cross checking and
> rearranging tables each time a user clicks table to sort will make it worse.
> Will there be a fix for it in future at api level itself?
> Should i try some other way round for it?
>
> On Wed, Jul 21, 2010 at 7:18 AM, MC Get Vizzy <[email protected]> wrote:
>
>> 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]<google-visualization-api%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-visualization-api?hl=en.
>>
>
>
>
> --
> regards,
> Akshay .Y. Dange.
> MS in Computer Science
> State University of New York, Binghamton
>
> --
> 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.

Reply via email to