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
234c264f
Commit
234c264f
authored
Feb 23, 2022
by
Anshul Riyal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored column chart responsiveness
parent
6172b14a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
22 deletions
+12
-22
app/assets/javascripts/monitoring/components/charts/column.vue
...ssets/javascripts/monitoring/components/charts/column.vue
+12
-22
No files found.
app/assets/javascripts/monitoring/components/charts/column.vue
View file @
234c264f
<
script
>
import
{
GlResizeObserverDirective
}
from
'
@gitlab/ui
'
;
import
{
GlColumnChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
makeDataSeries
}
from
'
~/helpers/monitor_helper
'
;
import
{
getSvgIconPathContent
}
from
'
~/lib/utils/icon_utils
'
;
...
...
@@ -12,9 +11,6 @@ export default {
components
:
{
GlColumnChart
,
},
directives
:
{
GlResizeObserverDirective
,
},
props
:
{
graphData
:
{
type
:
Object
,
...
...
@@ -83,11 +79,6 @@ export default {
formatLegendLabel
(
query
)
{
return
query
.
label
;
},
onResize
()
{
if
(
!
this
.
$refs
.
columnChart
)
return
;
const
{
width
}
=
this
.
$refs
.
columnChart
.
$el
.
getBoundingClientRect
();
this
.
width
=
width
;
},
setSvg
(
name
)
{
getSvgIconPathContent
(
name
)
.
then
((
path
)
=>
{
...
...
@@ -101,17 +92,16 @@ export default {
};
</
script
>
<
template
>
<div
v-gl-resize-observer-directive=
"onResize"
>
<gl-column-chart
ref=
"columnChart"
v-bind=
"$attrs"
:bars=
"barChartData"
:option=
"chartOptions"
:width=
"width"
:height=
"height"
:x-axis-title=
"xAxisTitle"
:y-axis-title=
"yAxisTitle"
:x-axis-type=
"xAxisType"
/>
</div>
<gl-column-chart
ref=
"columnChart"
v-bind=
"$attrs"
:responsive=
"true"
:bars=
"barChartData"
:option=
"chartOptions"
:width=
"width"
:height=
"height"
:x-axis-title=
"xAxisTitle"
:y-axis-title=
"yAxisTitle"
:x-axis-type=
"xAxisType"
/>
</
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