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
597c380e
Unverified
Commit
597c380e
authored
May 13, 2019
by
Torkel Ödegaard
Committed by
GitHub
May 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gauge: tweaks to background color and height usage (#17019)
parent
db95414d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
packages/grafana-ui/src/components/Gauge/Gauge.tsx
+4
-4
No files found.
packages/grafana-ui/src/components/Gauge/Gauge.tsx
View file @
597c380e
...
@@ -69,14 +69,14 @@ export class Gauge extends PureComponent<Props> {
...
@@ -69,14 +69,14 @@ export class Gauge extends PureComponent<Props> {
const
backgroundColor
=
selectThemeVariant
(
const
backgroundColor
=
selectThemeVariant
(
{
{
dark
:
theme
.
colors
.
dark
3
,
dark
:
theme
.
colors
.
dark
8
,
light
:
'#e6e6e6'
,
light
:
theme
.
colors
.
gray6
,
},
},
theme
.
type
theme
.
type
);
);
const
gaugeWidthReduceRatio
=
showThresholdLabels
?
1.5
:
1
;
const
gaugeWidthReduceRatio
=
showThresholdLabels
?
1.5
:
1
;
const
gaugeWidth
=
Math
.
min
(
dimension
/
6
,
40
)
/
gaugeWidthReduceRatio
;
const
gaugeWidth
=
Math
.
min
(
dimension
/
5
,
40
)
/
gaugeWidthReduceRatio
;
const
thresholdMarkersWidth
=
gaugeWidth
/
5
;
const
thresholdMarkersWidth
=
gaugeWidth
/
5
;
const
fontSize
=
Math
.
min
(
dimension
/
5.5
,
100
)
*
(
value
.
text
!==
null
?
this
.
getFontScale
(
value
.
text
.
length
)
:
1
);
const
fontSize
=
Math
.
min
(
dimension
/
5.5
,
100
)
*
(
value
.
text
!==
null
?
this
.
getFontScale
(
value
.
text
.
length
)
:
1
);
const
thresholdLabelFontSize
=
fontSize
/
2.5
;
const
thresholdLabelFontSize
=
fontSize
/
2.5
;
...
@@ -181,7 +181,7 @@ function calculateGaugeAutoProps(width: number, height: number, title: string |
...
@@ -181,7 +181,7 @@ function calculateGaugeAutoProps(width: number, height: number, title: string |
const
titleFontSize
=
Math
.
min
((
width
*
0.15
)
/
1.5
,
20
);
// 20% of height * line-height, max 40px
const
titleFontSize
=
Math
.
min
((
width
*
0.15
)
/
1.5
,
20
);
// 20% of height * line-height, max 40px
const
titleHeight
=
titleFontSize
*
1.5
;
const
titleHeight
=
titleFontSize
*
1.5
;
const
availableHeight
=
showLabel
?
height
-
titleHeight
:
height
;
const
availableHeight
=
showLabel
?
height
-
titleHeight
:
height
;
const
gaugeHeight
=
Math
.
min
(
availableHeight
*
0.7
,
width
);
const
gaugeHeight
=
Math
.
min
(
availableHeight
,
width
);
return
{
return
{
showLabel
,
showLabel
,
...
...
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