You are here

function hook_chart_alter in Charts 7.2

Same name and namespace in other branches
  1. 8.4 charts.api.php \hook_chart_alter()
  2. 8 charts.api.php \hook_chart_alter()
  3. 5.0.x charts.api.php \hook_chart_alter()

Alter an individual chart before it is printed.

Parameters

$chart: The chart renderable. Passed in by reference.

$chart_id: The chart identifier, pulled from the $chart['#chart_id'] property (if any). Not all charts have a chart identifier.

File

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

Code

function hook_chart_alter(&$chart, $chart_id) {
  if ($chart_id === 'view_name__display_name') {

    // Individual properties may be modified.
    $chart['#title_font_size'] = 20;
  }
}