request->getQuery('statistics_entry_amount', 5); $statistics_pie_include_remaining = $this->request->getQuery('statistics_include_remainging', true); if (is_string($statistics_pie_include_remaining)) { $statistics_pie_include_remaining = $statistics_pie_include_remaining == 'true' ? true : false; } $statistics_pie_ignore_null = $this->request->getQuery('statistics_ignore_null', true); if (is_string($statistics_pie_ignore_null)) { $statistics_pie_ignore_null = $statistics_pie_ignore_null == 'true' ? true : false; } $seedPiechart = 's-' . mt_rand(); foreach ($statistics['usage'] as $scope => $graphData) { $pieChart = $this->element('charts/pie', [ 'data' => $graphData, 'chartOptions' => [ 'chart' => [ 'height' => '80px', 'sparkline' => [ 'enabled' => true, ] ], 'plotOptions' => [ 'pie' => [ 'customScale' => 0.9, ] ], ], ]); $titleHtml = sprintf( '%s%s', Inflector::Pluralize(Inflector::Humanize(h($scope))), $this->Bootstrap->button([ 'variant' => 'link', 'icon' => 'cog', 'size' => 'xs', 'nodeType' => 'a', 'onclick' => '', 'class' => ['btn-statistics-pie-configurator-' . $seedPiechart], 'params' => [ 'data-bs-toggle' => 'popover', ] ]) ); $panelHtml = sprintf( '
%s%s
', $titleHtml, $pieChart ); $statPie = $this->Bootstrap->card([ 'variant' => 'secondary', 'bodyHTML' => $panelHtml, 'bodyClass' => 'py-1 px-2', 'class' => ['shadow-sm', 'h-100'] ]); $statisticsHtml .= sprintf('
%s
', $statPie); } ?>