Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <24865100.GETcoMUama@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 25 Apr 2013 10:25:01 +0200 User-Agent: KNode/4.8.5 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. MIME-Version: 1.0 Lines: 56 NNTP-Posting-Date: 25 Apr 2013 10:25:17 CEST NNTP-Posting-Host: 258cb045.newsspool1.arcor-online.net X-Trace: DXC=V^e7`IDooALI7\_^6>c20Jic==]BZ:afN4Fo<]lROoRAnkgeX?EC@@@>32E0LlHXPKDZm8W4\YJNLb@mF9jNikdE7a5\<`>]gfN=eUoi<@L`IG X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:19460 shawnroller10@gmail.com wrote: > I need some assistance in creating a data table from a JSON document. Thank you for _not_ saying (falsely) “JSON object”. I am not sure if “document” is the correct term either, though. > The data table format looks like this: > > { > […] > "rows": [ > {"c":[{"v":"2013-04-21"},{"v":101},{"v":153},{"v":189}]}, > {"c":[{"v":"2013-04-22"},{"v":109},{"v":145},{"v":175}]}, > {"c":[{"v":"2013-04-23"},{"v":95},{"v":165},{"v":201}]}, > {"c":[{"v":"2013-04-24"},{"v":114},{"v":147},{"v":193}]} > ] > } > > The cols are essentially columns of a table and each of the items in the > rows array are the values of the columns (ex. {"v":value}) > > A sample of my data, returned from a query via an Ajax command, might look > like this: > > {{[{ > […] > {"warehouse_id":"107","date":"2013-04-21","lane":"M01","routes":101} > "sort" : [ 1366675200000 ] > }, { > […] > {"warehouse_id":"107","date":"2013-04-21","lane":"M02","routes":153} > "sort" : [ 1366675200000 ] > }, { > […] > {"warehouse_id":"107","date":"2013-04-22","lane":"M01","routes":109} > "sort" : [ 1366675200000 ] > } ] > } > }... > > […] > Can someone assist in recommending a way to format this data? I'm > currently using an object, var ldata = {} but I need to put the data into > the ldata.cols and ldata.rows. The major obstacle is to get the proper > number (routes) for each lane and for each day. I do not see the “major obstacle”. What have you tried and how did it fail? And get a real name, please. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.