You can easily render 2D bar codes, known as QR Codes, with the Google Chart API, along with pie charts and bar graphs. If you haven't seen a QR Code before, you are looking at one on the right hand side (To see more, do an image search for "QR Code".)
QR Codes are a popular type of two-dimensional barcode. You can encode URLs, contact information, etc. into a black-and-white image like the one on the right. A QR-Code-enabled device can later scan the image and read back the original text. Learn more about QR Codes from Google Print Ads. If you don't have a reader Google also offers a QR Code decoder library: Zebra Crossing (ZXing).
This is how you can creating these with the Google Chart API:
Simply, there is a new chart type, qr, with attributes to tell the service what to produce:
cht=qr<text> is text for the QR code. This must be url-encoded in UTF8. Note the space between
chl=<text>
choe=<output>
hello and world is written as %20 in the following example.<output> optionally specifies how the text is encoded into bytes in the QR Code. If this is not specified the default of
UTF-8 is used. Available options are: Shift_JIS, UTF-8, or ISO-8859-1.For the details, please read the full documentation.

4 comments:
I can't seem to get the QR code to work. No matter what info I put in the URL the QR code says:
"Bad Request
Your client has issued a malformed or illegal request."
All other charts work correctly. Any thoughts?
-- Sean
You certainly miss to specify the chart size in the URL(I did the same during two minutes...).
To use chart API, you must provide AT LEAST the following parameters:
Chart size (chs)
Chart type (cht)
Chart data (...)
Here is a working example :
http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=YouRules&choe=ISO-8859-1
Ah, the example had no chart size, thus, a malformed request. Thanks!
-- Sean
This mashup http://qrmap.linkstore.ru lets you create QR-code for the selects Google map area.
Post a Comment