22 $items = $component->getItems();
23 if (count($items) == 0) {
27 $width = str_replace(
",",
".", round(100 / count($items), 5));
29 foreach ($component->getItems() as
$txt => $active) {
31 $tpl->setCurrentBlock(
"active");
32 $tpl->setVariable(
"TXT_ACTIVE", $this->
txt(
"active"));
33 $tpl->parseCurrentBlock();
34 $tpl->touchBlock(
"active_class");
37 $tpl->setCurrentBlock(
"item");
38 $tpl->setVariable(
"ITEM_TEXT", $txt);
39 $tpl->setVariable(
"ITEM_WIDTH", $width);
40 $tpl->parseCurrentBlock();
51 return array(
Component\Chart\ScaleBar::class);
getComponentInterfaceName()
render(Component\Component $component, RendererInterface $default_renderer)
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
txt($id)
Get a text from the language file.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.