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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
5b0890ed
Commit
5b0890ed
authored
Mar 21, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Legend text is now bolded also the Y legend text has a transparent background
to help differentiate legends
parent
b076d034
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
app/assets/javascripts/monitoring/prometheus_graph.js
app/assets/javascripts/monitoring/prometheus_graph.js
+13
-7
app/assets/stylesheets/pages/environments.scss
app/assets/stylesheets/pages/environments.scss
+9
-1
No files found.
app/assets/javascripts/monitoring/prometheus_graph.js
View file @
5b0890ed
...
@@ -129,7 +129,7 @@ class PrometheusGraph {
...
@@ -129,7 +129,7 @@ class PrometheusGraph {
.
attr
(
'
class
'
,
'
prometheus-graph-overlay
'
)
.
attr
(
'
class
'
,
'
prometheus-graph-overlay
'
)
.
attr
(
'
width
'
,
this
.
width
)
.
attr
(
'
width
'
,
this
.
width
)
.
attr
(
'
height
'
,
this
.
height
)
.
attr
(
'
height
'
,
this
.
height
)
.
on
(
'
mousemove
'
,
this
.
handleMouseOverGraph
.
bind
(
this
,
chart
,
prometheusGraphContainer
));
.
on
(
'
mousemove
'
,
this
.
handleMouseOverGraph
.
bind
(
this
,
prometheusGraphContainer
));
}
}
// The legends from the metric
// The legends from the metric
...
@@ -141,9 +141,9 @@ class PrometheusGraph {
...
@@ -141,9 +141,9 @@ class PrometheusGraph {
.
attr
(
'
stroke
'
,
'
#000000
'
)
.
attr
(
'
stroke
'
,
'
#000000
'
)
.
attr
(
'
stroke-width
'
,
'
1
'
)
.
attr
(
'
stroke-width
'
,
'
1
'
)
.
attr
({
.
attr
({
x1
:
0
,
x1
:
1
0
,
y1
:
this
.
originalHeight
-
80
,
y1
:
this
.
originalHeight
-
80
,
x2
:
this
.
originalWidth
-
this
.
margin
.
right
,
x2
:
(
this
.
originalWidth
-
this
.
margin
.
right
)
+
10
,
y2
:
this
.
originalHeight
-
80
,
y2
:
this
.
originalHeight
-
80
,
});
});
...
@@ -152,11 +152,17 @@ class PrometheusGraph {
...
@@ -152,11 +152,17 @@ class PrometheusGraph {
.
attr
(
'
stroke
'
,
'
#000000
'
)
.
attr
(
'
stroke
'
,
'
#000000
'
)
.
attr
(
'
stroke-width
'
,
'
1
'
)
.
attr
(
'
stroke-width
'
,
'
1
'
)
.
attr
({
.
attr
({
x1
:
0
,
x1
:
1
0
,
y1
:
0
,
y1
:
0
,
x2
:
0
,
x2
:
1
0
,
y2
:
this
.
originalHeight
-
80
,
y2
:
this
.
originalHeight
-
80
,
});
});
axisLabelContainer
.
append
(
'
rect
'
)
.
attr
(
'
class
'
,
'
rect-axis-text
'
)
.
attr
(
'
x
'
,
0
)
.
attr
(
'
y
'
,
50
)
.
attr
(
'
width
'
,
30
)
.
attr
(
'
height
'
,
150
);
axisLabelContainer
.
append
(
'
text
'
)
axisLabelContainer
.
append
(
'
text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
...
@@ -189,7 +195,7 @@ class PrometheusGraph {
...
@@ -189,7 +195,7 @@ class PrometheusGraph {
.
attr
(
'
height
'
,
35
);
.
attr
(
'
height
'
,
35
);
axisLabelContainer
.
append
(
'
text
'
)
axisLabelContainer
.
append
(
'
text
'
)
.
attr
(
'
class
'
,
'
label-axis-text
'
)
.
attr
(
'
class
'
,
'
text-metric-title
'
)
.
attr
(
'
x
'
,
this
.
originalWidth
-
140
)
.
attr
(
'
x
'
,
this
.
originalWidth
-
140
)
.
attr
(
'
y
'
,
(
this
.
originalHeight
/
2
)
-
50
)
.
attr
(
'
y
'
,
(
this
.
originalHeight
/
2
)
-
50
)
.
text
(
'
Average
'
);
.
text
(
'
Average
'
);
...
@@ -200,7 +206,7 @@ class PrometheusGraph {
...
@@ -200,7 +206,7 @@ class PrometheusGraph {
.
attr
(
'
y
'
,
(
this
.
originalHeight
/
2
)
-
25
);
.
attr
(
'
y
'
,
(
this
.
originalHeight
/
2
)
-
25
);
}
}
handleMouseOverGraph
(
chart
,
prometheusGraphContainer
)
{
handleMouseOverGraph
(
prometheusGraphContainer
)
{
const
rectOverlay
=
document
.
querySelector
(
`
${
prometheusGraphContainer
}
.prometheus-graph-overlay`
);
const
rectOverlay
=
document
.
querySelector
(
`
${
prometheusGraphContainer
}
.prometheus-graph-overlay`
);
const
currentXCoordinate
=
d3
.
mouse
(
rectOverlay
)[
0
];
const
currentXCoordinate
=
d3
.
mouse
(
rectOverlay
)[
0
];
...
...
app/assets/stylesheets/pages/environments.scss
View file @
5b0890ed
...
@@ -159,11 +159,19 @@
...
@@ -159,11 +159,19 @@
text
{
text
{
fill
:
$stat-graph-axis-fill
;
fill
:
$stat-graph-axis-fill
;
}
}
.label-axis-text
,
.text-metric-usage
{
fill
:
$black
;
font-weight
:
500
;
}
.legend-axis-text
{
fill
:
$black
;
}
}
}
.x-axis
path
,
.x-axis
path
,
.y-axis
path
,
.y-axis
path
,
.
label-
x-axis-line
,
.x-axis-line
,
.label-y-axis-line
{
.label-y-axis-line
{
fill
:
none
;
fill
:
none
;
stroke-width
:
1
;
stroke-width
:
1
;
...
...
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