mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(singlestat): fixed Gauge positioning issue, fixes #5143
This commit is contained in:
parent
ec19a97156
commit
a3f2f574c6
@ -234,13 +234,10 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
|||||||
var panel = ctrl.panel;
|
var panel = ctrl.panel;
|
||||||
var templateSrv = this.templateSrv;
|
var templateSrv = this.templateSrv;
|
||||||
var data, linkInfo;
|
var data, linkInfo;
|
||||||
var width, height;
|
|
||||||
var $panelContainer = elem.find('.panel-container');
|
var $panelContainer = elem.find('.panel-container');
|
||||||
elem = elem.find('.singlestat-panel');
|
elem = elem.find('.singlestat-panel');
|
||||||
|
|
||||||
function setElementHeight() {
|
function setElementHeight() {
|
||||||
width = elem.width();
|
|
||||||
height = elem.height();
|
|
||||||
elem.css('height', ctrl.height + 'px');
|
elem.css('height', ctrl.height + 'px');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,6 +284,9 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addGauge() {
|
function addGauge() {
|
||||||
|
var width = elem.width();
|
||||||
|
var height = elem.height();
|
||||||
|
|
||||||
ctrl.invalidGaugeRange = false;
|
ctrl.invalidGaugeRange = false;
|
||||||
if (panel.gauge.minValue > panel.gauge.maxValue) {
|
if (panel.gauge.minValue > panel.gauge.maxValue) {
|
||||||
ctrl.invalidGaugeRange = true;
|
ctrl.invalidGaugeRange = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user