I would like to use this chart type in a custom module. Any chance of it being implemented?

CommentFileSizeAuthor
#7 chart-463200.patch552 bytesquickcel

Comments

tjholowaychuk’s picture

thats what open source is for, go nuts :P

mitchell’s picture

I haven't tested these, but they seem to take care of QR Codes very well: Data Matrix API and even better with Mobile Codes.

tms8707056’s picture

Thanks!

mitchell’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

quickcel’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Closed (fixed) » Needs review

I was looking for something similar and it seems pretty easy to implement.

All you need to do is add the following line to the chart.module file:

define('CHART_TYPE_QR', 'qr');

Then if you want to implement you can use the following code:

<?php

/* MECARD FORMAT
$data = 'MECARD:';
$data .= 'N:Fname Lname;';
$data .= 'TEL:1234567890;';
$data .= 'EMAIL:email@example.com;';
$data .= 'URL:http://example.com;';
$data .= 'NOTE:This is a test note;';
*/

/* VCARD FORMAT
$data = 'BEGIN:VCARD' . "\n";
$data .= 'VERSION:3.0' . "\n";
$data .= 'N:Lname;Fname' . "\n";
$data .= 'FN:Fname Lname' . "\n";
$data .= 'ORG:Company Name' . "\n";
$data .= 'TITLE:Position' . "\n";
$data .= 'TEL;WORK:1234567890' . "\n";
$data .= 'TEL;CELL:1234567890' . "\n";
$data .= 'EMAIL:email@example.com' . "\n";
$data .= 'URL:http://example.com' . "\n";
$data .= 'END:VCARD';
*/

// TEXT
$data = t('This is some example text');

$chart = array(
  '#type' => CHART_TYPE_QR,
  '#size' => chart_size(200, 200), //define size in pixels
  '#chart_id' => 'qr_test',
  '#title' => t('QR Test'),
);

$chart['#data'][] = '';
$chart['#labels'][] = $data;

echo chart_render($chart);
?>

Do you think it would be possible to get this chart type added?

quickcel’s picture

StatusFileSize
new552 bytes

Here's a patch to help out

boombatower’s picture

Title: QR Code Chart Type » Add QR Code Chart Type
Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Fixed

Committed to 6.x-1.x and 7.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

white snow’s picture

You can take a look at this passage about QR Code barcode generation. Last time I used QR Code barcodes for my products and found solution on this website. Hope it can help you.

Anonymous’s picture

The Infographics & Image Charts (which includes QR Codes) features of Google Charts has been deprecated & will cease to function in 2015: http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-poli...

H.