> On Thu, Jan 15, 2009 at 12:49, Felipe Sologuren <[email protected]>
> wrote:
>>
>> 2009/1/15 JuanArg <[email protected]>
>>>
>>> Felipe,
>>>
>>> I need a external datasourcer... could be XML, CSV, text file or else.
>>
>> with CSV you could directly populate data because is supported by the API
>> http://code.google.com/apis/visualization/documentation/dev/implementing_data_source.html#csvdatatable
>>>

I dont think so somewhere [2]_ the API spec says :

«The default response format is JSON. This is the only response you
can request by calling the Google Visualization API method
google.visualization.Query.send(). »

Therefore I dont think this is gonna work with
google.visualization.Query.send() ... CMIIW

=ES=

No estoy muy seguro de esto ... en la especificación [2]_ se dice
explícitamente q el único formato q utiliza
google.visualization.Query.send() es 'json' ... ;)

On Thu, Jan 15, 2009 at 9:59 AM, Cumba, Juan José <[email protected]> wrote:
> Si, esa documentación la había visto pero la verdad que cuando quise
> implementarlo no pude darme cuenta como hacerlo...

Code snippets ... just simple examples ...

{{{

# Python
# Using gviz_api ... but there is no need to ... ;)
# ES: Utilizando el modulo gviz_api ... pero no es obligatorio usarlo ... ;)

>>> import gviz_api
>>> t = gviz_api.DataTable([('col1', 'number'), ('col2', 'string')])
>>> csv = r"""col1, col2
... 1, a
... 2, b
... 3, c"""
>>> t.AppendData([(int(c1), c2) for c1, c2 in map(lambda y: y.split(','), 
>>> csv.splitlines()[1:])])
>>> t.ToJSonResponse()
"google.visualization.Query.setResponse({'version':'0.5', 'reqId':'0',
'status':'OK', 'table': {cols:
[{id:'col1',label:'col1',type:'number'},{id:'col2',label:'col2',type:'string'}],rows:
[{c:[{v:1},{v:' a'}]},{c:[{v:2},{v:' b'}]},{c:[{v:3},{v:' c'}]}]}});"
>>>

}}}


PD: Two comments ... please avoid top-posting [1]_ ... please ...
please ... please ... ;)

Post comments in english ... so that non-spanish speakers can
understand what you are talking about ...

=ES=

Por favor ... eviten el top-posting ... por favor ...  ... por favor
...  ... por favor ...

Envíen siempre el mensaje en inglés a la lista para q los q no hablen
español (e.g.) puedan también ayudarlos ... y entiendan de lo q se
está hablando también ... ;)

.. [1] Wikipedia : Top-posting
        (http://en.wikipedia.org/wiki/Top_posting)

.. [2] Implementing a Data Source
        
(http://code.google.com/apis/visualization/documentation/dev/implementing_data_source.html#jsondatatable)


-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Añadir gadgets de Google en entradas (artículos) de Blogger.

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