Fix BarChart padding in Dashboard

Use max-width instead of width in the chart layout to make better use of the available space, but prevent the charts from growing too big. Use a bigger weight and height in the default dashboard configuration.

fixes #6744
This commit is contained in:
Matthias Jentsch 2014-07-21 13:06:35 +02:00
parent 091ddbe552
commit 53c9292b41
4 changed files with 18 additions and 10 deletions

View File

@ -23,13 +23,21 @@ sort = host_severity
title = "Landing page"
[Landing.Hostgroups]
url = "monitoring/chart/hostgroup?height=400&width=500"
url = "monitoring/chart/hostgroup"
height = 540
width = 540
[Landing.Servicegroups]
url = "monitoring/chart/servicegroup?height=360&width=450"
url = "monitoring/chart/servicegroup"
height = 540
width = 540
[Landing.Unhandled Problem Services]
url = "monitoring/list/services?service_handled=0&service_problem=1"
url = "monitoring/list/services"
service_handled = 0
service_problem = 1
[Landing.Unhandled Problem Hosts]
url = "monitoring/list/hosts?host_handled=0&host_problem=1"
url = "monitoring/list/hosts"
host_handled = 0
host_problem = 1

View File

@ -94,8 +94,8 @@ class Monitoring_ChartController extends Controller
'services_pending'
)
)->getQuery()->fetchAll();
$this->view->height = intval($this->getParam('height', 220));
$this->view->width = intval($this->getParam('width', 520));
$this->view->height = intval($this->getParam('height', 500));
$this->view->width = intval($this->getParam('width', 500));
if (count($query) === 1) {
$this->drawGroupPie($query[0]);
} else {
@ -119,8 +119,8 @@ class Monitoring_ChartController extends Controller
'services_pending'
)
)->getQuery()->fetchAll();
$this->view->height = intval($this->getParam('height', 220));
$this->view->width = intval($this->getParam('width', 520));
$this->view->height = intval($this->getParam('height', 500));
$this->view->width = intval($this->getParam('width', 500));
$this->drawServiceGroupChart($query);

View File

@ -1,5 +1,5 @@
<div style="width:<?= $this->width; ?>px;height:<?= $this->height; ?>px;margin:auto;">
<div style="max-width:<?= $this->width; ?>px;max-height:<?= $this->height; ?>px;margin:auto;">
<?=
$chart->render();
?>

View File

@ -1,5 +1,5 @@
<div style="width:<?= $this->width; ?>px;height:<?= $this->height; ?>px">
<div style="max-width:<?= $this->width; ?>px;max-height:<?= $this->height; ?>px;margin:auto;">
<?=
$chart->render();
?>