0) { $variationIcon = 'arrow-up'; $variationClass = 'bg-success'; } else { $variationIcon = 'arrow-down'; $variationClass = 'bg-danger'; } $variationHtml = sprintf('
%s
', $variationClass, $this->FontAwesome->getClass($variationIcon), !empty($variation) ? h($variation) : '' ); $titleHtml = isset($title) ? h($title) : ($titleHtml ?? ''); $leftContent = sprintf('
%s

%s

%s', $titleHtml, h($number ?? ''), $variationHtml ); $rightContent = sprintf('
%s
', $this->element('charts/bar', [ 'chartData' => $chartData, 'chartOptions' => [ ] ])); $cardContent = sprintf('
%s
%s
', $leftContent, $rightContent); echo $this->Bootstrap->card([ 'variant' => 'secondary', 'bodyHTML' => $cardContent, 'bodyClass' => 'p-3', 'class' => 'grow-on-hover shadow-sm' ]); ?>