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><form action='http://chart.apis.google.com/chart'
method='POST' id='post_form'>
<input type="hidden" name="cht"
value="lc" />
<input type="hidden" name="chtt"
value="This is | my chart" />
<input type='hidden' name='chs' value='300x200' />
<input type="hidden" name="chxt"
value="x" />
<input type='hidden' name='chd' value='t:40,20,50,20,100'/
>
<input type="submit" />
</form>
</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.