Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b46b84f1
Unverified
Commit
b46b84f1
authored
Apr 08, 2019
by
Torkel Ödegaard
Committed by
GitHub
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Singlestat: Use decimal override when manually specified (#16451)
Fixes #16373
parent
3c42fece
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
public/app/plugins/panel/singlestat/module.ts
+10
-12
No files found.
public/app/plugins/panel/singlestat/module.ts
View file @
b46b84f1
...
...
@@ -191,7 +191,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
data
.
value
=
0
;
data
.
valueRounded
=
0
;
}
else
{
const
decimalInfo
=
getDecimalsForValue
(
data
.
value
);
const
decimalInfo
=
getDecimalsForValue
(
data
.
value
,
this
.
panel
.
decimals
);
const
formatFunc
=
getValueFormat
(
this
.
panel
.
format
);
data
.
valueFormatted
=
formatFunc
(
...
...
@@ -199,7 +199,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
decimalInfo
.
decimals
,
decimalInfo
.
scaledDecimals
);
data
.
valueRounded
=
kbn
.
roundValue
(
data
.
value
,
this
.
panel
.
decimals
||
0
);
data
.
valueRounded
=
kbn
.
roundValue
(
data
.
value
,
decimalInfo
.
decimals
);
}
this
.
setValueMapping
(
data
);
...
...
@@ -279,17 +279,15 @@ class SingleStatCtrl extends MetricsPanelCtrl {
data
.
value
=
this
.
series
[
0
].
stats
[
this
.
panel
.
valueName
];
data
.
flotpairs
=
this
.
series
[
0
].
flotpairs
;
let
decimals
=
this
.
panel
.
decimals
;
let
scaledDecimals
=
0
;
const
decimalInfo
=
getDecimalsForValue
(
data
.
value
,
this
.
panel
.
decimals
);
if
(
!
this
.
panel
.
decimals
)
{
const
decimalInfo
=
getDecimalsForValue
(
data
.
value
);
decimals
=
decimalInfo
.
decimals
;
scaledDecimals
=
decimalInfo
.
scaledDecimals
;
}
data
.
valueFormatted
=
formatFunc
(
data
.
value
,
decimals
,
scaledDecimals
,
this
.
dashboard
.
isTimezoneUtc
());
data
.
valueRounded
=
kbn
.
roundValue
(
data
.
value
,
decimals
);
data
.
valueFormatted
=
formatFunc
(
data
.
value
,
decimalInfo
.
decimals
,
decimalInfo
.
scaledDecimals
,
this
.
dashboard
.
isTimezoneUtc
()
);
data
.
valueRounded
=
kbn
.
roundValue
(
data
.
value
,
decimalInfo
.
decimals
);
}
// Add $__name variable for using in prefix or postfix
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment