Only apply SVG responsiveness when not rendered in compact mode
Don't let SVGs grow vertically in when displayed in the dashboard, to avoid wasted space
This commit is contained in:
parent
648debff88
commit
e799d65d3f
|
@ -22,6 +22,11 @@ use Icinga\Chart\Unit\StaticAxis;
|
|||
|
||||
class Monitoring_ChartController extends Controller
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->view->compact = $this->_request->getParam('view') === 'compact';
|
||||
}
|
||||
|
||||
public function testAction()
|
||||
{
|
||||
$this->chart = new GridChart();
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
<div class="chart">
|
||||
<?=
|
||||
$chart->render();
|
||||
?>
|
||||
</div>
|
||||
<?php if (! $this->compact) { ?>
|
||||
<div class="svg-container-responsive">
|
||||
<?= $chart->render(); ?>
|
||||
<?= isset($chart2) ? $chart2->render() : ''; ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<?= $chart->render(); ?>
|
||||
<?php } ?>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
<div class="chart">
|
||||
<?=
|
||||
$chart->render();
|
||||
?>
|
||||
</div>
|
||||
<?php if (! $this->compact) { ?>
|
||||
<div class="svg-container-responsive">
|
||||
<?= $chart->render(); ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<?= $chart->render(); ?>
|
||||
<?php } ?>
|
||||
|
|
|
@ -175,6 +175,7 @@ ul.tree li a.error:hover {
|
|||
}
|
||||
|
||||
/* charts should grow as much as possible but never beyond the current viewport's size */
|
||||
div.chart {
|
||||
height: 90vh;
|
||||
.svg-container-responsive {
|
||||
padding: 1.5em;
|
||||
height: 80vh;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue