'FusionCharts'); case 'charttypes': return array( 'line2D' => t('Line 2D'), 'hbar2D' => t('Horizontal Bar 2D'), 'vbar2D' => t('Vertical Bar 2D'), 'pie2D' => t('Pie 2D'), ); } } /** * Immplementation of hook_chartsapi(). * * Its a Charts module hook. It transform the data into a HTML chart. * * @param &$data * Array. The */ function fusioncharts_chartsapi(&$data) { // Include the specific Google Chart API helper functions include_once drupal_get_path('module', 'fusioncharts') .'/fusioncharts.inc'; // Convert the chat TYPE into the FusionCharts way. // Since its a requirement to build the chart on Google, if the value // was not found, return nothing and stop the execution. $options = array( 'line2D' => '/Charts/MSCombi2D.swf', ); if (empty($options[$data['basic']['charttype']])) { return ''; } $swf = url(drupal_get_path('module', 'fusioncharts') . $options[$data['basic']['charttype']]); // Convert the chat SIZE into the FusionCharts way. // Since its a requirement to build the chart on Google, if the value // was not found, return nothing and stop the execution. if (empty($data['layout']['width']) or empty($data['layout']['height'])) { return ''; } $width = $data['layout']['width']; $height = $data['layout']['height']; // Convert the chat DATA into the FusionCharts way. // Since its a requirement to build the chart on Google, if the value // was not found, return nothing and stop the execution. foreach ($data['data'] as $series) { $xml['value'][] = _fusioncharts_values('set', $series); } $xml = 'dataXML='. _fusioncharts_xml_elements(array($xml)); // Its the HTML tag to include the chart return << FUSIONCHARTS; }