I’m using django-googlecharts to generate a simple pie chart. Inside the img tag, it works just fine, but if I paste the img src in the location bar of the browser, google returns “Bad Request”, “Your client has issued a malformed or illegal request”.
I followed the example in the django-googlecharts documentation here:
http://github.com/jacobian/django-googlecharts/blob/master/docs/examples.html
and actually, these examples from the documentation have the same problem. So, for example:
<img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chl=One|Two|Three&chd=e:VVqq.." width="300" height="200" alt="It worked!" />
works fine in the web page, but the src cut and pasted into the browser location bar does not:
http://chart.apis.google.com/chart?chs=300x200&cht=p&chl=One|Two|Three&chd=e:VVqq..
I don’t know if this is an encoding problem or something else. I’ve been trying to embed these charts in an HTML email without luck, and I’m wondering if figuring this part out will lead to solution. Thanks for your help!
The browser interprets the escaped ampersands
&into real ampersands&when used in an image tag, but not when directly put into the address bar.The url
http://chart.apis.google.com/chart?chs=300x200&cht=p&chl=One|Two|Three&chd=e:VVqq..works just fine in the browser.