No, it is not a bug. The Table has no way of knowing how the data is
sorted (or even if it is sorted at all) when you draw it, unless you
specify the sorting in the Table's options, eg:
table.draw(data, {
sortColumn: 1,
sortAscending: false
});
The "sortColumn" option tells the Table which column you sorted the data
on, and the "sortAscending" option tells the Table whether the sort was
ascending or not. Neither option makes the Table do its own sort, but
together they will set the sort state so that the arrow shows up
appropriately and that clicking the header to sort the data woks
appropriately.
On Wednesday, July 9, 2014 3:23:22 PM UTC-4, Azfar Alam wrote:
>
> I'm using the Google Visualization table and noticed that when I set the
> default sort to the first column, the *sort arrow* doesn't show up next
> to the column header.
>
> More specifically, when I add this code:
>
> data.sort([{column: 1, desc:true}, {column: 0}]);
>
> I get this:
>
> <https://lh5.googleusercontent.com/-U4yme65Iz34/U72VjmPlYfI/AAAAAAAAAOg/92ZlI2a2b10/s1600/Screen+Shot+2014-07-09+at+12.17.44+PM.png>
>
>
>
>
> instead of this (the arrow shows up after I click the column header once) :
>
> <https://lh6.googleusercontent.com/-NyX-I6lcdKg/U72V5ycJKzI/AAAAAAAAAOw/gz0Zu_KitqE/s1600/Screen+Shot+2014-07-09+at+12.19.42+PM.png>
>
>
>
>
>
> What's more is that in order to do an ascending sort, I have to click the
> column header twice. First time to get the arrow to show up, next time to
> actually get the sort done.
>
> Is this a small bug by any chance, or a way to fix around this?
>
> Thanks!
>
--
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/d/optout.