',
- $view->protectId($this->getMonitoredObjectIdentifier()),
- $view->translate('Show More'),
- $view->translate('Show Less')
- );
+ $renderedGraphs = 0;
+ foreach ((empty($concreteTemplates) ? $defaultTemplates : $concreteTemplates) as $templateName => $template) {
+ $charts = $template->getCharts(static::getMetricsDataSource(), $filter, $this->checkCommand);
+ if (! empty($charts)) {
+ foreach ($charts as $chart) {
+ if (empty($result)) {
+ $result[] = $div;
+ } elseif ($limit && $renderedGraphs === $limit) {
+ $result[] = sprintf(
+ '
'
+ . '
'
+ . '
',
+ $view->protectId($this->getMonitoredObjectIdentifier()),
+ $view->translate('Show More'),
+ $view->translate('Show Less')
+ );
+ }
+
+ $imageUrl = $this->filterImageUrl($imageBaseUrl->with($chart->getMetricVariables()))
+ ->setParam('template', $templateName)
+ ->setParam('start', $this->start)
+ ->setParam('end', $this->end)
+ ->setParam('width', $this->width)
+ ->setParam('height', $this->height)
+ ->setParam('cachebuster', time() * 65536 + mt_rand(0, 65535));
+ if (! $this->compact) {
+ $imageUrl->setParam('legend', 1);
+ }
+
+ $result[] = '
 $imageUrl;
+ $result[] = ')
';
+ $renderedGraphs++;
}
-
- $imageUrl = $this->filterImageUrl($imageBaseUrl->with($chart->getMetricVariables()))
- ->setParam('template', $templateName)
- ->setParam('start', $this->start)
- ->setParam('end', $this->end)
- ->setParam('width', $this->width)
- ->setParam('height', $this->height)
- ->setParam('cachebuster', time() * 65536 + mt_rand(0, 65535));
- if (! $this->compact) {
- $imageUrl->setParam('legend', 1);
- }
-
- $result[] = '
 $imageUrl;
- $result[] = ')
';
- $renderedGraphs++;
}
}
- }
- if (! empty($result)) {
- if ($limit && $renderedGraphs > $limit) {
+ if (! empty($result)) {
+ if ($limit && $renderedGraphs > $limit) {
+ $result[] = '