Sounds good except when I wrap the example in the documentation all I
get is a blank page!!! In other words the javascript inside the page
does not seem to be executed by appengine.

class MyResults(webapp.RequestHandler):
    def get(self):

        self.response.out.write("""
        <html xmlns="http://www.w3.org/1999/xhtml";>
        <head>
        <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
        <script type='application/javascript'>
        // Send the POST when the page is loaded,
        // which will replace this whole page with the retrieved
chart.
        function loadGraph() {
        var frm = document.getElementById('post_form');
        if (frm) {
        frm.submit();
        }
        }
        </script>
        </head>
        <body onload="loadGraph()">
        <form action='http://chart.apis.google.com/chart'
method='POST' id='post_form'>
        <pre>&lt;form action='http://chart.apis.google.com/chart'
method='POST' id='post_form'&gt;
        &lt;input type=&quot;hidden&quot; name=&quot;cht&quot;
value=&quot;lc&quot;  /&gt;
        &lt;input type=&quot;hidden&quot; name=&quot;chtt&quot;
value=&quot;This is | my chart&quot;  /&gt;
        &lt;input type='hidden' name='chs' value='300x200' /&gt;
        &lt;input type=&quot;hidden&quot; name=&quot;chxt&quot;
value=&quot;x&quot; /&gt;
        &lt;input type='hidden' name='chd' value='t:40,20,50,20,100'/
&gt;
        &lt;input type=&quot;submit&quot;  /&gt;
        &lt;/form&gt;
        </body>
        </html>""")

On Feb 21, 10:50 pm, yegle <[email protected]> wrote:
> No matter what script language you use, the output in user's browser is just
> HTML.
> So you just need to output the correct HTML contains the JavaScript which
> calls the chart API, that's all :-)
>
>
>
> On Mon, Feb 22, 2010 at 2:19 PM, sjh <[email protected]> wrote:
> > Hi,
>
> > The new chart api allows the post option to load more data points:
>
> >http://code.google.com/apis/chart/docs/post_requests.html
>
> > In the docs above there is a javascript example which uses the onload
> > command to do a form post in page (i.e. without a submit button). I am
> > using appengine and cannot figure out how to do the equivalent in
> > python. I want to point to a page which automatically loads the chart.
>
> > Any suggestions much appreciated.
>
> > thanks, Simon
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Chart API" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-chart-api%2Bunsubscrib 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-chart-api?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart 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-chart-api?hl=en.

Reply via email to