You are here

charts.module in Charts 6

@author Bruno Massa http://drupal.org/user/67164

Transform DATA into INFORMATION using beautiful CHARTS.

@note only hooks are here. @note For instructions about the API, see chart_api.txt file.

File

charts.module
View source
<?php

/**
 * @author Bruno Massa http://drupal.org/user/67164
 * @file
 * Transform DATA into INFORMATION using beautiful CHARTS.
 *
 * @note only hooks are here.
 * @note For instructions about the API, see chart_api.txt file.
 */

/**
 * The main Chart API function, that calls any chart provider
 * to print the given data.
 *
 * @param &$data
 *   Array. The chart data, described on chart_api.txt
 * @return
 *   String. The HTML with the propper chart (might include Flash or
 *   JavaScript external files)
 */
function charts_chart(&$data) {
  module_load_include('inc', 'charts');
  return _charts_chart($data);
}

/**
 * Implementation of hook_chart_types().
 */
function charts_chart_types() {
  return array(
    'line2D' => t('Line 2D'),
    'hbar2D' => t('Horizontal Bar 2D'),
    'vbar2D' => t('Vertical Bar 2D'),
    'pie2D' => t('Pie 2D'),
    'pie3D' => t('Pie 3D'),
  );
}

/**
 * Implementation of hook_menu().
 */
function charts_menu() {
  $items['admin/settings/charts'] = array(
    'access arguments' => array(
      'set default settings for charts',
    ),
    'description' => 'Set the default behaviour and look of all your charts',
    'file' => 'charts.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      '_charts_settings_page',
    ),
    'title' => 'Charts',
  );
  return $items;
}

/**
 * Implementation of hook_perm().
 */
function charts_perm() {
  return array(
    'set default settings for charts',
  );
}

/**
 * Implementation of hook_theme().
 */
function charts_theme() {
  return array(
    'charts_settings_color' => array(
      'arguments' => array(
        'form' => NULL,
      ),
    ),
  );
}

/**
 * Implementation of hook_views_api().
 */
function charts_views_api() {
  return array(
    'api' => 2,
    'path' => drupal_get_path('module', 'charts') . '/views',
  );
}

Functions

Namesort descending Description
charts_chart The main Chart API function, that calls any chart provider to print the given data.
charts_chart_types Implementation of hook_chart_types().
charts_menu Implementation of hook_menu().
charts_perm Implementation of hook_perm().
charts_theme Implementation of hook_theme().
charts_views_api Implementation of hook_views_api().