FIX FOUND- 3 major changes were made that broke the unpublished
version of API
Two things changed in the query.setResponse object between the
unpublished version and the new version-
First- in the 'Cols' the 'type' used to accept 'd' and 'n'- now you
must type the full 'date' and 'number' ('t' for text would now be
'string')
Secondly- in the rows- you need to wrap what you had in {c:[ <old> ]}
so the old way:
rows: [
[{v:new Date(2008,7,12),f:'2008-08-12'},{v:1.0,f:'1'}],
[{v:new Date(2008,7,12),f:'2008-08-12'},{v:1.0,f:'1'}]
]
will now be:
rows: [
{c:[{v:new Date(2008,7,12),f:'2008-08-12'},{v:
1.0,f:'1'}]},
{c:[{v:new Date(2008,7,13),f:'2008-08-13'},{v:
1.0,f:'1'}]},
]
Latestly- if you are also running custom JS code in the response, it
must be BELOW the setResponse() call - I was returning some custom
javascript code to set variables- (i used it to store the color of the
lines i just added for constiancy) - This code MUST be below the
setResponse line- you will get an error if you try to do custom JS
code before the setResponse line! (probably related to how they
detect what response format you are returning...)
Have fun,
--Robert
On May 12, 1:13 pm, Robert <[email protected]> wrote:
> I am also having this problem- it seems like it has to do w/ it
> parsing json responses as CSV
>
> I eliminated the blank lines and now i'm getting -
>
> [Exception... "'Error: First column must contain date, or date and
> time.' when calling method: [nsIDOMEventListener::handleEvent]"
> nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS
> frame :: chrome://firebug/content/spy.js ::
> onHTTPSpyReadyStateChange :: line 497" data: no]
> [Break on this error] (no source for chrome://firebug/content/spy.js)
>
> Did you change the default response format from json to something
> else??
>
> It looks like it's trying to parse the json as a csv ... if i try
> adding "&tqx=reqId:0;out:csv" it drops it and puts it's own tqx on my
> url- it drops the 'out' and only has a tqx=reqId:0
>
> google.visualization.Query.setResponse(
> {
> reqId:'0',
> status:'ok',
> table: {
> cols: [
> {id: 'Date', label:'Date',type:'d', pattern:'yyyy-
> MM-dd'},
> {id: 'Traffic', label:'Traffic',type:'n',
> pattern:'#0.###############'}
> ],
> rows: [
> [{v:new Date(2009,4,11),f:'2009-05-11'},{v:
> 0,f:'0'}],
> [{v:new Date(2009,4,12),f:'2009-05-12'},{v:0,f:'0'}]
> ]
> } //end table
> }
> );
>
> that triggers my error related to 'first column must be date'
>
> Please fix this!!!
>
> Thanks
> --Robert
>
> On May 12, 11:35 am, Unruly-Dev <[email protected]> wrote:
>
> > We also got the parenthesis issue at the same time, our problem was
> > also fixed by removing a carriage return prior to the setResponse
> > line.
> > It had previously been working fine.
>
> > On May 11, 8:01 pm, VizGuy <[email protected]> wrote:
>
> > > So this parenthesis issue is not yet clear to us, but I am glad it
> > > stopped...I am not sure its related to our change, but we are still
> > > investigating.
>
> > > If you have more info, please update.
>
> > > Thanks,
> > > VizGuy
>
> > > On Mon, May 11, 2009 at 8:27 PM, Trymbill <[email protected]> wrote:
>
> > > > Update: It's working now. Doesn't return a javascript error as of
> > > > from now. Hope that will hold :)
>
> > > > On May 11, 1:24 pm, Trymbill <[email protected]> wrote:
> > > > > I've got the same problem. Today my code doesn't work, here is the
> > > > > javascript error firebug outputs:
>
> > > > > missing ) in parenthetical on line 262 of the .js file [
> > > >http://www.google.com/uds/api/visualization/1.0/28bfe89c82011ce9762b7...
> > > > > ]
>
> > > > > We haven't changed anything in our code the last couple of days and
> > > > > this happened all of a sudden so I guess it's related to this thread.
>
> > > > > Hope to hear a response soon!
>
> > > > > Sincerely,
> > > > > Magnus
>
> > > > > On May 11, 7:54 am, viz-adict <[email protected]> wrote:
>
> > > > > > Help!
>
> > > > > > My application doesn't work today!!!
>
> > > > > > Firebug launches errors on line 232, 263 of
>
> > > > > >http://www.google.com/uds/api/visualization/1.0/28bfe89c82011ce9762b7.
> > > > ..
>
> > > > > > any idea????
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---