BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d6b0e23a
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
graph.vue
app/assets/javascripts/monitoring/components/graph.vue
+1
-0
legend.vue
...assets/javascripts/monitoring/components/graph/legend.vue
+15
-7
path.vue
app/assets/javascripts/monitoring/components/graph/path.vue
+12
-0
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 @@
:key=
"index"
:generated-line-path=
"path.linePath"
:generated-area-path=
"path.areaPath"
:line-style=
"path.lineStyle"
:line-color=
"path.lineColor"
:area-color=
"path.areaColor"
/>
...
...
app/assets/javascripts/monitoring/components/graph/legend.vue
View file @
d6b0e23a
...
...
@@ -92,6 +92,12 @@
}
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
()
{
this
.
$nextTick
(()
=>
{
...
...
@@ -162,13 +168,15 @@
v-for=
"(series, index) in timeSeries"
:key=
"index"
:transform=
"translateLegendGroup(index)"
>
<rect
:fill=
"series.areaColor"
:width=
"measurements.legends.width"
:height=
"measurements.legends.height"
x=
"20"
:y=
"graphHeight - measurements.legendOffset"
>
</rect>
<line
:stroke=
"series.lineColor"
:stroke-width=
"measurements.legends.height"
:stroke-dasharray=
"strokeDashArray(series.lineStyle)"
x1=
"20"
:x2=
"20 + measurements.legends.width"
:y1=
"graphHeight - measurements.legendOffset"
:y2=
"graphHeight - measurements.legendOffset"
>
</line>
<text
v-if=
"timeSeries.length > 1"
class=
"legend-metric-title"
...
...
app/assets/javascripts/monitoring/components/graph/path.vue
View file @
d6b0e23a
...
...
@@ -9,6 +9,10 @@
type
:
String
,
required
:
true
,
},
lineStyle
:
{
type
:
String
,
required
:
true
,
},
lineColor
:
{
type
:
String
,
required
:
true
,
...
...
@@ -18,6 +22,13 @@
required
:
true
,
},
},
computed
:
{
strokeDashArray
()
{
if
(
this
.
lineStyle
===
'dashed'
)
return
'3, 1'
;
if
(
this
.
lineStyle
===
'dotted'
)
return
'1, 1'
;
return
null
;
},
},
};
</
script
>
<
template
>
...
...
@@ -34,6 +45,7 @@
:stroke=
"lineColor"
fill=
"none"
stroke-width=
"1"
:stroke-dasharray=
"strokeDashArray"
transform=
"translate(-5, 20)"
>
</path>
</g>
...
...
app/assets/javascripts/monitoring/utils/measurements.js
View file @
d6b0e23a
...
...
@@ -7,7 +7,7 @@ export default {
left
:
40
,
},
legends
:
{
width
:
1
0
,
width
:
1
5
,
height
:
3
,
},
backgroundLegend
:
{
...
...
@@ -15,7 +15,7 @@ export default {
height
:
50
,
},
axisLabelLineOffset
:
-
20
,
legendOffset
:
3
3
,
legendOffset
:
3
2
,
},
large
:
{
// This covers both md and lg screen sizes
margin
:
{
...
...
@@ -33,7 +33,7 @@ export default {
height
:
150
,
},
axisLabelLineOffset
:
20
,
legendOffset
:
3
6
,
legendOffset
:
3
4
,
},
xTicks
:
8
,
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