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
5561a099
Commit
5561a099
authored
Oct 06, 2017
by
Alexander Zobnin
Committed by
Torkel Ödegaard
Oct 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
singlestat: fix sizing bug #9337 (#9448)
parent
7af4daf2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
public/app/plugins/panel/singlestat/module.ts
+8
-4
No files found.
public/app/plugins/panel/singlestat/module.ts
View file @
5561a099
...
...
@@ -432,7 +432,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
function
addGauge
()
{
var
width
=
elem
.
width
();
var
height
=
elem
.
height
();
var
dimension
=
Math
.
min
(
width
,
height
);
// Allow to use a bit more space for wide gauges
var
dimension
=
Math
.
min
(
width
,
height
*
1.3
);
ctrl
.
invalidGaugeRange
=
false
;
if
(
panel
.
gauge
.
minValue
>
panel
.
gauge
.
maxValue
)
{
...
...
@@ -469,8 +470,11 @@ class SingleStatCtrl extends MetricsPanelCtrl {
var
fontScale
=
parseInt
(
panel
.
valueFontSize
)
/
100
;
var
fontSize
=
Math
.
min
(
dimension
/
5
,
100
)
*
fontScale
;
var
gaugeWidth
=
Math
.
min
(
dimension
/
6
,
60
);
// Reduce gauge width if threshold labels enabled
var
gaugeWidthReduceRatio
=
panel
.
gauge
.
thresholdLabels
?
1.5
:
1
;
var
gaugeWidth
=
Math
.
min
(
dimension
/
6
,
60
)
/
gaugeWidthReduceRatio
;
var
thresholdMarkersWidth
=
gaugeWidth
/
5
;
var
thresholdLabelFontSize
=
fontSize
/
2.5
;
var
options
=
{
series
:
{
...
...
@@ -491,8 +495,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
values
:
thresholds
,
label
:
{
show
:
panel
.
gauge
.
thresholdLabels
,
margin
:
8
,
font
:
{
size
:
18
}
margin
:
thresholdMarkersWidth
+
1
,
font
:
{
size
:
thresholdLabelFontSize
}
},
show
:
panel
.
gauge
.
thresholdMarkers
,
width
:
thresholdMarkersWidth
,
...
...
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