small code cleanup in grafanaGraph

This commit is contained in:
Torkel Ödegaard
2014-04-05 19:22:23 +02:00
parent 347f6aed3f
commit 5cd73cea4b
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -45,7 +45,15 @@ function (angular, $, kbn, moment, _) {
function setElementHeight() {
try {
elem.css({ height: scope.height || scope.panel.height || scope.row.height });
var height = scope.height || scope.panel.height || scope.row.height;
height = height.replace('px', '') - 32; // subtract panel title bar
if (scope.panel.legend.show) {
height = height - 35; // subtract one line legend
}
elem.css('height', height + 'px');
return true;
} catch(e) { // IE throws errors sometimes
return false;
+1 -1
View File
@@ -77,7 +77,7 @@ code, pre {
}
.panel-content {
padding: 0px 10px 10px 10px;
padding: 0px 10px 0 10px;
}
.panel-title {