From 5de69b288f0ff4540188b5415b1073e3ad20c256 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 5 Jan 2016 19:21:12 +0100 Subject: [PATCH] feat(singlestat): make sparkline height dynamic closes #3553 --- public/app/plugins/panels/singlestat/singleStatPanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panels/singlestat/singleStatPanel.js b/public/app/plugins/panels/singlestat/singleStatPanel.js index b04f1c57dcd..a176ea974ae 100644 --- a/public/app/plugins/panels/singlestat/singleStatPanel.js +++ b/public/app/plugins/panels/singlestat/singleStatPanel.js @@ -97,7 +97,8 @@ function (angular, app, _, $) { plotCss.bottom = '5px'; plotCss.left = '-5px'; plotCss.width = (width - 10) + 'px'; - plotCss.height = (height - 45) + 'px'; + var dynamicHeightMargin = height <= 100 ? 5 : (Math.round((height/100)) * 15) + 5; + plotCss.height = (height - dynamicHeightMargin) + 'px'; } else { plotCss.bottom = "0px";