Skip to content

Commit 5de69b2

Browse files
committed
feat(singlestat): make sparkline height dynamic
closes grafana#3553
1 parent 5c0812a commit 5de69b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

public/app/plugins/panels/singlestat/singleStatPanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ function (angular, app, _, $) {
9797
plotCss.bottom = '5px';
9898
plotCss.left = '-5px';
9999
plotCss.width = (width - 10) + 'px';
100-
plotCss.height = (height - 45) + 'px';
100+
var dynamicHeightMargin = height <= 100 ? 5 : (Math.round((height/100)) * 15) + 5;
101+
plotCss.height = (height - dynamicHeightMargin) + 'px';
101102
}
102103
else {
103104
plotCss.bottom = "0px";

0 commit comments

Comments
 (0)