You are here

function hook_charts_info in Charts 7.2

Same name and namespace in other branches
  1. 8 charts.api.php \hook_charts_info()

Provide a new charting library to the system.

Libraries provided by this function will be made available as a choice for rendering charts in the Charts interface. Any libraries specified in this hook may be used as a #chart_library property on $chart renderables.

2 functions implement hook_charts_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

charts_google_charts_info in modules/charts_google/charts_google.module
Implements hook_charts_info().
charts_highcharts_charts_info in modules/charts_highcharts/charts_highcharts.module
Implements hook_charts_info().
1 invocation of hook_charts_info()
charts_info in ./charts.module
Retrieve a list of all charting libraries available.

File

./charts.api.php, line 134
Documentation on hooks provided by the Charts module.

Code

function hook_charts_info() {
  $info['my_charting_library'] = array(
    'label' => t('New charting library'),
    // Specify a callback function which will be responsible for accepting a
    // $chart renderable and printing a chart on the page.
    'render' => '_my_charting_library_render',
    // Specify the chart types your library is capable of providing.
    'types' => array(
      'area',
      'bar',
      'column',
      'line',
      'pie',
      'scatter',
    ),
    // If your callback function is in a separate file, specify it's location.
    'file' => 'includes/my_charting_library.inc',
  );
  return $info;
}