Perhaps you found a better solution by now but I figured I would respond anyway for kicks.<div><br></div><div>I reworked my example to use an XMLHttp object to GET some JSON that would do the exact same thing except it a) returns the column headers and b) it returns the data in a single statement:</div>
<div><br></div><div><div class="SYN_ROW"><div class="SYN_LNB"><input class="SYN_LNN" value="73" type="label"><input id="syn_ctrl73" class="SYN_BCH" value="-" type="label"></div><div style="TEXT-INDENT: -0.5em; PADDING-LEFT: 1em" id="syn_row73" class="SYN_TXT">
<span class="HTML_TXT"><span class="JS_TXT">        </span></span>
</div></div><div class="SYN_ROW"><div class="SYN_LNB"><input class="SYN_LNN" value="74" type="label"><input id="syn_ctrl74" class="SYN_BCH" value="-" type="label"></div><div style="TEXT-INDENT: -0.5em; PADDING-LEFT: 1em" id="syn_row74" class="SYN_TXT">
<span class="HTML_TXT"><span class="JS_TXT">           data.addRows(myJSONObj.actualData);</span></span>
</div></div><div class="SYN_ROW"><div class="SYN_LNB"><input class="SYN_LNN" value="75" type="label"><input id="syn_ctrl75" class="SYN_BCH" value="-" type="label"></div><div style="TEXT-INDENT: -0.5em; PADDING-LEFT: 1em" id="syn_row75" class="SYN_TXT">
<span class="HTML_TXT"><span class="JS_TXT"> </span></span>
</div></div><div><br></div><div>The JSON looks like this: </div><div>{</div><div>  &quot;columns&quot;:[&quot;Sales&quot;,&quot;SalesValue&quot;],</div><div>  &quot;actualData&quot;:[</div><div>                 [&quot;2001&quot;,100],</div>
<div>                 [&quot;2002&quot;,200],</div><div>                 [&quot;2003&quot;,300],</div><div>                 [&quot;2004&quot;,400],</div><div>                 [&quot;2005&quot;,800]</div><div>              ]  </div>
<div>}</div><div><br></div><div>Again, the actual example is here: <a href="http://www.bixchange.com/cgi-bin/bixchange/bixchange.cgi?pom=test-gsapi;iid=0001">http://www.bixchange.com/cgi-bin/bixchange/bixchange.cgi?pom=test-gsapi;iid=0001</a></div>
<div><br></div><div>Some problems I noticed</div><div>-------------------------------------</div><div><br></div><div>My original idea was to use HTML::Template to push out JSON the same way one pushes out HTML. This didn&#39;t pan out because I wanted to format a JSON array with a TMPL_LOOP but it wound up producing an extra comma at the end.  That was causing a JSON parsing error in IE.  Apparently the inability to parse an extra comma at the end of the array definition is documented on the Google visualization website somewhere and was pretty annoying.</div>
<div><br></div><div>All in all, the code example is pretty sloppy but works.  I borrowed much of the browser check code and I think it is rubbish so please don&#39;t copy any of that for anything important. I also assumed that the first column would always be text and the other columns of data would be numeric. I&#39;m certain that you could come up with something better.  Lastly I used an eval() in the code to convert the server&#39;s response text to a JavaScript object. There is some concern on the web that this may be a vulnerability so I would research using better methods.</div>
<div><br></div><div class="gmail_quote">On Mon, Aug 2, 2010 at 3:18 PM, Jay Strauss <span dir="ltr">&lt;<a href="mailto:me@heyjay.com">me@heyjay.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt;<br>
&gt; I would imagine the JSON example is pretty much the exact same thing except<br>
&gt; you just create a separate template to push out JSON and return this back to<br>
&gt; a static HTML file pointing to its URL.  This is pretty elementary stuff,<br>
&gt; however...perhaps I&#39;m missing the problem here...?<br>
</div>&gt; --<br>
<div class="im">&gt; Sincerely,<br>
&gt;<br>
&gt;&gt; _______________________________________________</div><div class="im">
&gt; Chicago-talk mailing list<br>
&gt; <a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
&gt; <a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
&gt;<br>
<br>
<br>
</div>So outside the fact that I&#39;m a pretty elementary fellow, and your way<br>
is perfectly fine, and I was starting to think I&#39;d need to do<br>
something similar, I thought based on my reading of the docs, that I<br>
could be one of the K00L kids.<br>
<br>
I thought I could have my Javascript call the data source directly.<br>
And there was some magic in the google javascript classes that would<br>
take the CVS file that is returned and stick it in the data source<br>
automagically.  That way my source web page that is delivered to the<br>
browser wouldn&#39;t be thousands of lines long of:<br>
data.addRows<br>
data.addRows<br>
data.addRows<br>
...<br>
<br>
Again, its very possible (dare I say probable) I&#39;m total incorrect<br>
about how this google visualization stuff works.  But it looks like<br>
you can do what I&#39;m talking about if the datasource is a google<br>
spreadsheet.<br>
<div><div></div><div class="h5"><br>
Thanks<br>
Jay<br>
_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
</div></div></blockquote></div><br><br clear="all"><br>
</div>