Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e49ce626
Commit
e49ce626
authored
Feb 23, 2022
by
Anshul Riyal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored gauge chart responsiveness
parent
6172b14a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
24 deletions
+12
-24
app/assets/javascripts/monitoring/components/charts/gauge.vue
...assets/javascripts/monitoring/components/charts/gauge.vue
+12
-24
No files found.
app/assets/javascripts/monitoring/components/charts/gauge.vue
View file @
e49ce626
<
script
>
import
{
GlResizeObserverDirective
}
from
'
@gitlab/ui
'
;
import
{
GlGaugeChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
isFinite
,
isArray
,
isInteger
}
from
'
lodash
'
;
import
{
getFormatter
,
SUPPORTED_FORMATS
}
from
'
~/lib/utils/unit_format
'
;
...
...
@@ -10,9 +9,6 @@ export default {
components
:
{
GlGaugeChart
,
},
directives
:
{
GlResizeObserverDirective
,
},
props
:
{
graphData
:
{
type
:
Object
,
...
...
@@ -96,27 +92,19 @@ export default {
return
this
.
queryResult
||
NaN
;
},
},
methods
:
{
onResize
()
{
if
(
!
this
.
$refs
.
gaugeChart
)
return
;
const
{
width
}
=
this
.
$refs
.
gaugeChart
.
$el
.
getBoundingClientRect
();
this
.
width
=
width
;
},
},
};
</
script
>
<
template
>
<div
v-gl-resize-observer-directive=
"onResize"
>
<gl-gauge-chart
ref=
"gaugeChart"
v-bind=
"$attrs"
:value=
"value"
:min=
"rangeValues.min"
:max=
"rangeValues.max"
:thresholds=
"thresholdsValue"
:text=
"textValue"
:split-number=
"splitValue"
:width=
"width"
/>
</div>
<gl-gauge-chart
ref=
"gaugeChart"
v-bind=
"$attrs"
:responsive=
"true"
:value=
"value"
:min=
"rangeValues.min"
:max=
"rangeValues.max"
:thresholds=
"thresholdsValue"
:text=
"textValue"
:split-number=
"splitValue"
:width=
"width"
/>
</
template
>
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