Hi

You can set the view which sorts the table inside the ChartWrapper:
http://code.google.com/apis/chart/interactive/docs/reference.html#chartwrapperobject
If you have the DataTable locally available in javascript, you can just
create a DataView over that table and sort it according to your
preferences:
http://code.google.com/apis/chart/interactive/docs/reference.html#DataView

Hope this helps,
  Viz Kid


On Thu, Jul 28, 2011 at 12:37 AM, 140Kit Team <[email protected]> wrote:

> Hey all,
>
> I'm in a constant struggle with Google's visualization api, but I
> really don't see anything better, so I'm coming to you all with my
> bind. Let's say we have some data, like the number of tweets per
> language for a set of tweets. In this case, our breakdown may look
> something like:
>
> +----------+-------+
> | label    | value |
> +----------+-------+
> | German   | 21    |
> | English  | 448   |
> | Spanish  | 30    |
> | French   | 7     |
> | Italian  | 2     |
> | Japanese | 1     |
> +----------+-------+
>
> So, I set up a service on my site that exposes this data in the
> fashion I have seen to work with google charts, and a little piece of
> code to access and draw() the graph. Altogether, the snippet would
> look something like this pastie: http://pastie.org/2281512.
>
> So, my question is pretty simple. I don't want to pre-sort everything
> on the database end, as it would get particularly messing in
> determining what to sort by (as the code on that level is very
> abstracted from the business of displaying any particular graph). It
> would be better to sort it once loaded in js, and spit the sorted
> version out in the graph. How would one sort this particular graph by
> something like value (the number of people per language)? Would it
> just make more sense to load direct json like that located at
> http://test.140kit.com/test.json, and then sort and display that? what
> would the js look like for that?
>
> As you can tell, i know some programming but I'm basically useless and
> utterly defeated/hopeless when it comes to js. Any help would be very,
> very welcome.
>
> Thanks much.
>
> --
> 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.
>
>

-- 
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