0

Simple question: every chart created with Google Charts, when saved as an image, is named "chart.png". Is there a way to force another name? That way if I export a bunch of QR codes at once I can give them meaningful names.

I couldn't find anything in the documentation or here about simply renaming the .png

Kartikeya Khosla
  • 18,743
  • 8
  • 43
  • 69
Bing
  • 3,071
  • 6
  • 42
  • 81
  • What code do you currently have to save the chart? How do you save them? – Halvor Holsten Strand Jul 29 '14 at 00:05
  • CTRL+S, or right-click "Save Image As" – Bing Jul 29 '14 at 19:33
  • After using `getImageURI()`? – Halvor Holsten Strand Jul 29 '14 at 19:39
  • No, I've been doing manual saves. When you try to save like that the names are always chart.png, and I'd like to be able to specify. Then I can generate a bunch of QR codes on a webpage, name them each to something meaningful, and when I download the entire PAGE (CTRL+S) I have phone_number.png, email_address.png, etc. instead of chart.png chart2.png, etc. – Bing Jul 29 '14 at 20:13

1 Answers1

0

The short answer is no. Because the last part of the URL for creating QR codes from Google Charts (which is deprecated and will be phased out 2015-4-20) is chart, that is also the name that most browsers (new Chrome, IE, FF) use as a file name. Also, Google seems to not have provided any way to alter this URL-ending.

The long answer is that it would be possible for you to circumvent this, but not trivial.

Forwarder with forged URL (source)

One option would be to create a PHP-page (or similar) of your own that just presents the content of Googles QR code, and where you control the last part of the URL. For example:

http://example.com/forwarder.php/mychart.png?chs=150x150&cht=qr&chl=Hello+world

You could then use this URL as the src of your image. This would also require you to have som specific settings to allow the above URL format without giving a 404 error message.

Other service

Depending on your requirements for variations of charts, devotion to making this work, and what service you'd like to use for doing this I'd suggest looking for some other way (site/framework) of generating your QR codes that does give you control over this parameter.

Obscure possiblities

Community
  • 1
  • 1
Halvor Holsten Strand
  • 19,829
  • 17
  • 83
  • 99