summaryrefslogtreecommitdiffstats
path: root/chart.api.php
blob: d2412a361ffe4bd9caab9295e69dfe9589f90734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
 * @file
 * Provides API documentation.
 *
 * @author Jimmy Berry ("boombatower", http://drupal.org/user/214218)
 */

/**
 * Alter a chart before it is rendered.
 *
 * @param $chart
 *   An associative array defining a chart.
 * @see chart_build()
 */
function hook_chart_alter(&$chart) {
  $chart['#title'] .= ' (altered)';
}

/**
 * Define chart color schemes.
 *
 * @return
 *   An associative array of color schemes keyed by the scheme name and
 *   containing an array of colors.
 */
function hook_chart_color_schemes() {
  return array(
    'my_scheme' => array(
      'FF8000',
      'FFFFFF',
    ),
  );
}

/**
 * Alter chart color schemes.
 *
 * @param $schemes
 *   An associative array of color schemes, see hook_chart_color_schemes().
 */
function hook_chart_color_schemes_alter(&$schemes) {
  $schemes['default'] = array(
    'FFFFFF',
    '000000',
  );
}