function template_preprocess_charts_chart in Charts 5.0.x
Same name and namespace in other branches
- 8.4 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'] : '',
];
}