function charts_openflash_data in Charts and Graphs 7
Same name and namespace in other branches
- 6 apis/charts_openflash/charts_openflash.module \charts_openflash_data()
Parameters
$cid: cache_id from which cache to retrieve the data
1 string reference to 'charts_openflash_data'
- charts_openflash_menu in apis/
charts_openflash/ charts_openflash.module
File
- apis/
charts_openflash/ charts_openflash.module, line 35 - drupal module file implementing openflash charting
Code
function charts_openflash_data($cid = null) {
$cache = cache_get($cid);
if (!$cache) {
drupal_not_found();
exit;
}
$canvas = $cache->data;
$chart = chart_graphs_get_graph('open-flash');
$chart
->get_data_from_cache($cid);
/*$chart = <<<JSON
{ "elements": [ { "type": "pie", "colours": [ "#77CC6D", "#FF5973", "#6D86CC" ], "border": 2, "animate": true, "label-colour": "#432BAF", "alpha": 0.75, "tip": "#label#
$#val# (#percent#)", "on-click": "pie_slice_clicked", "values": [ { "value": 120, "label": "X" }, { "value": 99, "label": "Y" }, { "value": 21, "label": "Z", "on-click": "http:\/\/example.com" } ] } ] }';
JSON;*/
//drupal_set_header('Content-Type: text/javascript; charset=utf-8');
//echo $chart;
drupal_json($chart);
exit;
}