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
1e283044
Commit
1e283044
authored
Feb 22, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide legend without hiding the axis labels
parent
2e66da48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
35 deletions
+42
-35
app/assets/javascripts/monitoring/components/graph.vue
app/assets/javascripts/monitoring/components/graph.vue
+2
-2
app/assets/javascripts/monitoring/components/graph/legend.vue
...assets/javascripts/monitoring/components/graph/legend.vue
+40
-33
No files found.
app/assets/javascripts/monitoring/components/graph.vue
View file @
1e283044
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
);
);
if
(
!
this
.
showLegend
)
{
if
(
!
this
.
showLegend
)
{
this
.
baseGraphHeight
-=
6
0
;
this
.
baseGraphHeight
-=
5
0
;
}
else
if
(
this
.
timeSeries
.
length
>
3
)
{
}
else
if
(
this
.
timeSeries
.
length
>
3
)
{
this
.
baseGraphHeight
=
this
.
baseGraphHeight
+=
(
this
.
timeSeries
.
length
-
3
)
*
20
;
this
.
baseGraphHeight
=
this
.
baseGraphHeight
+=
(
this
.
timeSeries
.
length
-
3
)
*
20
;
}
}
...
@@ -253,7 +253,6 @@
...
@@ -253,7 +253,6 @@
transform=
"translate(70, 20)"
transform=
"translate(70, 20)"
/>
/>
<graph-legend
<graph-legend
v-if=
"showLegend"
:graph-width=
"graphWidth"
:graph-width=
"graphWidth"
:graph-height=
"graphHeight"
:graph-height=
"graphHeight"
:margin=
"margin"
:margin=
"margin"
...
@@ -263,6 +262,7 @@
...
@@ -263,6 +262,7 @@
:time-series=
"timeSeries"
:time-series=
"timeSeries"
:unit-of-display=
"unitOfDisplay"
:unit-of-display=
"unitOfDisplay"
:current-data-index=
"currentDataIndex"
:current-data-index=
"currentDataIndex"
:show-legend-group=
"showLegend"
/>
/>
<svg
<svg
class=
"graph-data"
class=
"graph-data"
...
...
app/assets/javascripts/monitoring/components/graph/legend.vue
View file @
1e283044
...
@@ -39,6 +39,11 @@
...
@@ -39,6 +39,11 @@
type
:
Number
,
type
:
Number
,
required
:
true
,
required
:
true
,
},
},
showLegendGroup
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -166,39 +171,41 @@
...
@@ -166,39 +171,41 @@
>
>
Time
Time
</text>
</text>
<g
<template
v-if=
"showLegendGroup"
>
class=
"legend-group"
<g
v-for=
"(series, index) in timeSeries"
class=
"legend-group"
:key=
"index"
v-for=
"(series, index) in timeSeries"
:transform=
"translateLegendGroup(index)"
:key=
"index"
>
:transform=
"translateLegendGroup(index)"
<line
:stroke=
"series.lineColor"
:stroke-width=
"measurements.legends.height"
:stroke-dasharray=
"strokeDashArray(series.lineStyle)"
:x1=
"measurements.legends.offsetX"
:x2=
"measurements.legends.offsetX + measurements.legends.width"
:y1=
"graphHeight - measurements.legends.offsetY"
:y2=
"graphHeight - measurements.legends.offsetY"
/>
<text
v-if=
"timeSeries.length > 1"
class=
"legend-metric-title"
ref=
"legendTitleSvg"
x=
"38"
:y=
"graphHeight - 30"
>
{{
createSeriesString
(
index
,
series
)
}}
</text>
<text
v-else
class=
"legend-metric-title"
ref=
"legendTitleSvg"
x=
"38"
:y=
"graphHeight - 30"
>
>
{{
legendTitle
}}
{{
formatMetricUsage
(
series
)
}}
<line
</text>
:stroke=
"series.lineColor"
</g>
:stroke-width=
"measurements.legends.height"
:stroke-dasharray=
"strokeDashArray(series.lineStyle)"
:x1=
"measurements.legends.offsetX"
:x2=
"measurements.legends.offsetX + measurements.legends.width"
:y1=
"graphHeight - measurements.legends.offsetY"
:y2=
"graphHeight - measurements.legends.offsetY"
/>
<text
v-if=
"timeSeries.length > 1"
class=
"legend-metric-title"
ref=
"legendTitleSvg"
x=
"38"
:y=
"graphHeight - 30"
>
{{
createSeriesString
(
index
,
series
)
}}
</text>
<text
v-else
class=
"legend-metric-title"
ref=
"legendTitleSvg"
x=
"38"
:y=
"graphHeight - 30"
>
{{
legendTitle
}}
{{
formatMetricUsage
(
series
)
}}
</text>
</g>
</
template
>
</g>
</g>
</template>
</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