Posted by tms8707056 on May 15, 2009 at 2:49am
| Project: | Google chart API |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I would like to use this chart type in a custom module. Any chance of it being implemented?
Comments
#1
thats what open source is for, go nuts :P
#2
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.
#3
Thanks!
#4
#5
Automatically closed -- issue fixed for 2 weeks with no activity.
#6
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?
#7
Here's a patch to help out
#8
Committed to 6.x-1.x and 7.x-1.x
#9
Automatically closed -- issue fixed for 2 weeks with no activity.