|
|
@@ -63,6 +63,17 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
|
|
render_panel();
|
|
|
});
|
|
|
|
|
|
+ function getLegendHeight() {
|
|
|
+ if (!scope.panel.legend.show || scope.panel.legend.rightSide) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ if (scope.panel.legend.alignAsTable) {
|
|
|
+ return 30 + (25 * data.length);
|
|
|
+ } else {
|
|
|
+ return 26;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function setElementHeight() {
|
|
|
try {
|
|
|
graphHeight = scope.height || scope.panel.height || scope.row.height;
|
|
|
@@ -73,9 +84,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
|
|
graphHeight -= 5; // padding
|
|
|
graphHeight -= scope.panel.title ? 24 : 9; // subtract panel title bar
|
|
|
|
|
|
- if (scope.panel.legend.show && !scope.panel.legend.rightSide) {
|
|
|
- graphHeight = graphHeight - 26; // subtract one line legend
|
|
|
- }
|
|
|
+ graphHeight = graphHeight - getLegendHeight(); // subtract one line legend
|
|
|
|
|
|
elem.css('height', graphHeight + 'px');
|
|
|
|