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
59c081e8
Unverified
Commit
59c081e8
authored
Apr 07, 2019
by
Torkel Ödegaard
Committed by
GitHub
Apr 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BarGauge: Fixed minor margin issue (#16419)
Fixed margin issue that was not accounted for in width calc (#16419)
parent
a5a0352d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
packages/grafana-ui/src/components/BarGauge/BarGauge.tsx
+8
-2
packages/grafana-ui/src/components/BarGauge/__snapshots__/BarGauge.test.tsx.snap
+1
-1
No files found.
packages/grafana-ui/src/components/BarGauge/BarGauge.tsx
View file @
59c081e8
...
...
@@ -286,7 +286,7 @@ export function getTitleStyles(props: Props): { wrapper: CSSProperties; title: C
titleStyles
.
width
=
`
${
titleDim
.
width
}
px`
;
titleStyles
.
textAlign
=
'right'
;
titleStyles
.
margin
Right
=
'10px'
;
titleStyles
.
padding
Right
=
'10px'
;
}
}
...
...
@@ -344,6 +344,11 @@ function calculateBarAndValueDimensions(props: Props): BarAndValueDimensions {
}
}
// console.log('titleDim', titleDim);
// console.log('valueWidth', valueWidth);
// console.log('width', width);
// console.log('total', titleDim.width + maxBarWidth + valueWidth);
return
{
valueWidth
,
valueHeight
,
...
...
@@ -409,7 +414,8 @@ export function getBasicAndGradientStyles(props: Props): BasicAndGradientStyles
barStyles
.
transition
=
'width 1s'
;
barStyles
.
height
=
`
${
maxBarHeight
}
px`
;
barStyles
.
width
=
`
${
barWidth
}
px`
;
barStyles
.
marginRight
=
'10px'
;
valueStyles
.
paddingLeft
=
'10px'
;
if
(
isBasic
)
{
// Basic styles
...
...
packages/grafana-ui/src/components/BarGauge/__snapshots__/BarGauge.test.tsx.snap
View file @
59c081e8
...
...
@@ -20,6 +20,7 @@ exports[`BarGauge Render with basic options should render 1`] = `
"display": "flex",
"fontSize": "27.27px",
"height": "300px",
"paddingLeft": "10px",
"width": "60px",
}
}
...
...
@@ -33,7 +34,6 @@ exports[`BarGauge Render with basic options should render 1`] = `
"borderRadius": "3px",
"borderRight": "2px solid #73BF69",
"height": "300px",
"marginRight": "10px",
"transition": "width 1s",
"width": "60px",
}
...
...
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