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
d6b0e23a
Commit
d6b0e23a
authored
Nov 05, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dashed and dotted line styles for multiple-query graphs
parent
5af31d6e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
app/assets/javascripts/monitoring/components/graph.vue
app/assets/javascripts/monitoring/components/graph.vue
+1
-0
app/assets/javascripts/monitoring/components/graph/legend.vue
...assets/javascripts/monitoring/components/graph/legend.vue
+15
-7
app/assets/javascripts/monitoring/components/graph/path.vue
app/assets/javascripts/monitoring/components/graph/path.vue
+12
-0
app/assets/javascripts/monitoring/utils/measurements.js
app/assets/javascripts/monitoring/utils/measurements.js
+3
-3
No files found.
app/assets/javascripts/monitoring/components/graph.vue
View file @
d6b0e23a
...
@@ -247,6 +247,7 @@
...
@@ -247,6 +247,7 @@
:key=
"index"
:key=
"index"
:generated-line-path=
"path.linePath"
:generated-line-path=
"path.linePath"
:generated-area-path=
"path.areaPath"
:generated-area-path=
"path.areaPath"
:line-style=
"path.lineStyle"
:line-color=
"path.lineColor"
:line-color=
"path.lineColor"
:area-color=
"path.areaColor"
:area-color=
"path.areaColor"
/>
/>
...
...
app/assets/javascripts/monitoring/components/graph/legend.vue
View file @
d6b0e23a
...
@@ -92,6 +92,12 @@
...
@@ -92,6 +92,12 @@
}
}
return
`
${
this
.
legendTitle
}
series
${
index
+
1
}
${
this
.
formatMetricUsage
(
series
)}
`
;
return
`
${
this
.
legendTitle
}
series
${
index
+
1
}
${
this
.
formatMetricUsage
(
series
)}
`
;
},
},
strokeDashArray
(
type
)
{
if
(
type
===
'
dashed
'
)
return
'
6, 3
'
;
if
(
type
===
'
dotted
'
)
return
'
3, 3
'
;
return
null
;
},
},
},
mounted
()
{
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -162,13 +168,15 @@
...
@@ -162,13 +168,15 @@
v-for=
"(series, index) in timeSeries"
v-for=
"(series, index) in timeSeries"
:key=
"index"
:key=
"index"
:transform=
"translateLegendGroup(index)"
>
:transform=
"translateLegendGroup(index)"
>
<rect
<line
:fill=
"series.areaColor"
:stroke=
"series.lineColor"
:width=
"measurements.legends.width"
:stroke-width=
"measurements.legends.height"
:height=
"measurements.legends.height"
:stroke-dasharray=
"strokeDashArray(series.lineStyle)"
x=
"20"
x1=
"20"
:y=
"graphHeight - measurements.legendOffset"
>
:x2=
"20 + measurements.legends.width"
</rect>
:y1=
"graphHeight - measurements.legendOffset"
:y2=
"graphHeight - measurements.legendOffset"
>
</line>
<text
<text
v-if=
"timeSeries.length > 1"
v-if=
"timeSeries.length > 1"
class=
"legend-metric-title"
class=
"legend-metric-title"
...
...
app/assets/javascripts/monitoring/components/graph/path.vue
View file @
d6b0e23a
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
lineStyle
:
{
type
:
String
,
required
:
true
,
},
lineColor
:
{
lineColor
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -18,6 +22,13 @@
...
@@ -18,6 +22,13 @@
required
:
true
,
required
:
true
,
},
},
},
},
computed
:
{
strokeDashArray
()
{
if
(
this
.
lineStyle
===
'
dashed
'
)
return
'
3, 1
'
;
if
(
this
.
lineStyle
===
'
dotted
'
)
return
'
1, 1
'
;
return
null
;
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -34,6 +45,7 @@
...
@@ -34,6 +45,7 @@
:stroke=
"lineColor"
:stroke=
"lineColor"
fill=
"none"
fill=
"none"
stroke-width=
"1"
stroke-width=
"1"
:stroke-dasharray=
"strokeDashArray"
transform=
"translate(-5, 20)"
>
transform=
"translate(-5, 20)"
>
</path>
</path>
</g>
</g>
...
...
app/assets/javascripts/monitoring/utils/measurements.js
View file @
d6b0e23a
...
@@ -7,7 +7,7 @@ export default {
...
@@ -7,7 +7,7 @@ export default {
left
:
40
,
left
:
40
,
},
},
legends
:
{
legends
:
{
width
:
1
0
,
width
:
1
5
,
height
:
3
,
height
:
3
,
},
},
backgroundLegend
:
{
backgroundLegend
:
{
...
@@ -15,7 +15,7 @@ export default {
...
@@ -15,7 +15,7 @@ export default {
height
:
50
,
height
:
50
,
},
},
axisLabelLineOffset
:
-
20
,
axisLabelLineOffset
:
-
20
,
legendOffset
:
3
3
,
legendOffset
:
3
2
,
},
},
large
:
{
// This covers both md and lg screen sizes
large
:
{
// This covers both md and lg screen sizes
margin
:
{
margin
:
{
...
@@ -33,7 +33,7 @@ export default {
...
@@ -33,7 +33,7 @@ export default {
height
:
150
,
height
:
150
,
},
},
axisLabelLineOffset
:
20
,
axisLabelLineOffset
:
20
,
legendOffset
:
3
6
,
legendOffset
:
3
4
,
},
},
xTicks
:
8
,
xTicks
:
8
,
yTicks
:
3
,
yTicks
:
3
,
...
...
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