Whether you get JSON or CSV depends on the request you make. I don't see documentation about an option in the Query class, but the URL makes a difference. See:
https://developers.google.com/chart/interactive/docs/dev/implementing_data_source#csv-response-format I see also that there is a way of requesting an HTML table. Not sure that still works, and you don't get a DataTable that you can use with other charts. I know the TSV method is now broken. Also see other pages for some possibly useful hints. https://developers.google.com/chart/interactive/docs/queries https://developers.google.com/chart/interactive/docs/php_example On Sat, Apr 22, 2017 at 5:02 AM, Nick Dunbar <[email protected]> wrote: > Hi Dan, > > Thanks for getting back to me. > > Just so I understand, what response does Google sheets provide - JSON or > CSV? I have gotten so used to the seamless way that Google sheets works > with the Query function that doing something outside the framework looks > like a lot of work. > > However, people tell me I should not bother with another 3rd party cloud > document storage system but instead bite the bullet and set up my own MySQL > data hosting in a way that works with Query function and my library of > existing Google chart scripts. From looking at this forum, it appears quite > a few users have done something like that. > > Do you know of any documentation or cheat sheet that makes it > straightforward to do this? Any suggestions or advice would be welcome. > > Best regards, > NIck > > > > On Friday, April 21, 2017 at 8:28:15 PM UTC+1, Daniel LaLiberte wrote: >> >> Sorry Nick, but there is no option for processing the response in other >> ways. Basically, the response must either be JSON or CSV. There is also a >> jsonp mechanism, but that also requires JS notation. >> >> But you could always use another query library, such as the one that >> jQuery has. There is not a way to use this with the ChartWrapper, however, >> if that is what you are thinking of, unless you maybe override the >> google.visualization.Query function with your own. That sounds like a lot >> of work, if it will work at all. >> >> >> On Fri, Apr 21, 2017 at 10:47 AM, Nick Dunbar <[email protected]> wrote: >> >>> Hi, >>> >>> I have started using a cloud storage system, Zoho Docs, for uploading >>> spreadsheet data into the visualization API using the Query function. I >>> used to do this with Google sheets but had to switch because a client had a >>> compliance issue with Google docs. >>> >>> Unfortunately, Zoho's shared URLs don't load into Query - it throws an >>> error "SyntaxError: Unexpected token '<'", and examination of the console >>> shows that the URL source has <!DOCTYPE html > at the beginning which >>> results in the error. >>> >>> Is there a way of putting an argument into Query such that it skips over >>> HTML tags and just reads the Javascript in the Zoho file? All help with >>> this would be much appreciated. >>> >>> Best regards, >>> >>> Nick >>> >>> -- >>> 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 https://groups.google.com/grou >>> p/google-visualization-api. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/google-visualization-api/ce935b7e-9aed-445a-bb0a-dc3319 >>> bc7b83%40googlegroups.com >>> <https://groups.google.com/d/msgid/google-visualization-api/ce935b7e-9aed-445a-bb0a-dc3319bc7b83%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> >> [email protected] 5CC, Cambridge MA >> > -- > 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 google-visualization-api@ > googlegroups.com. > Visit this group at https://groups.google.com/ > group/google-visualization-api. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/google-visualization-api/4be5f313-55c8-4110-9743- > 0b439a1b41a8%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/4be5f313-55c8-4110-9743-0b439a1b41a8%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- 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 https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJPrSO_GW1q%3DYuy0GZUAw507Tv73k1fnro%3D2HAn3OmqN%3Dg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
