You are here

function template_preprocess_charts_chart in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x charts.module \template_preprocess_charts_chart()

Implements hook_preprocess_HOOK().

File

./charts.module, line 51
Charts - Module.

Code

function template_preprocess_charts_chart(&$variables) {
  $element = $variables['element'];
  $attributes = $element['#attributes'];
  $attributes['id'] = $element['#id'];
  $attributes['class'][] = 'chart';
  $variables['content'] = [
    '#type' => 'html_tag',
    '#tag' => 'div',
    '#attributes' => $attributes,
    '#value' => isset($element['#chart']) ? $element['#chart'] : '',
  ];
}