You are here

function hook_chart_alter in Charts 5.0.x

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. 7.2 charts.api.php \hook_chart_alter()

Alter an individual chart before it is printed.

Parameters

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

string $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 76
Documentation on hooks provided by the Charts module.

Code

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

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