File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
public/app/plugins/panel/singlestat Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
278
278
return body ;
279
279
}
280
280
281
+ function getValueText ( ) {
282
+ var result = panel . prefix ? panel . prefix : '' ;
283
+ result += data . valueFormated ;
284
+ result += panel . postfix ? panel . postfix : '' ;
285
+
286
+ return result ;
287
+ }
288
+
281
289
function addGauge ( ) {
282
290
var plotCanvas = $ ( '<div></div>' ) ;
283
291
var plotCss = {
@@ -332,7 +340,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
332
340
} ,
333
341
value : {
334
342
color : panel . colorValue ? getColorForValue ( data , data . valueRounded ) : null ,
335
- formatter : function ( ) { return data . valueFormated ; } ,
343
+ formatter : function ( ) { return getValueText ( ) ; } ,
336
344
font : { size : getGaugeFontSize ( ) }
337
345
} ,
338
346
show : true
@@ -419,6 +427,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
419
427
420
428
function render ( ) {
421
429
if ( ! ctrl . data ) { return ; }
430
+ ctrl . setValues ( ctrl . data ) ;
422
431
data = ctrl . data ;
423
432
setElementHeight ( ) ;
424
433
You can’t perform that action at this time.
0 commit comments