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
e2c39ec9
Commit
e2c39ec9
authored
Mar 29, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render burndown chart lines
parent
dab26c55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
app/assets/javascripts/burndown_chart/burndown_chart.js
app/assets/javascripts/burndown_chart/burndown_chart.js
+19
-0
app/assets/stylesheets/pages/milestone.scss
app/assets/stylesheets/pages/milestone.scss
+15
-0
No files found.
app/assets/javascripts/burndown_chart/burndown_chart.js
View file @
e2c39ec9
...
...
@@ -13,6 +13,8 @@ export default class BurndownChart {
this
.
chartGroup
=
this
.
canvas
.
append
(
'
g
'
).
attr
(
'
class
'
,
'
chart
'
);
this
.
xAxisGroup
=
this
.
chartGroup
.
append
(
'
g
'
).
attr
(
'
class
'
,
'
x axis
'
);
this
.
yAxisGroup
=
this
.
chartGroup
.
append
(
'
g
'
).
attr
(
'
class
'
,
'
y axis
'
);
this
.
idealLinePath
=
this
.
chartGroup
.
append
(
'
path
'
).
attr
(
'
class
'
,
'
ideal line
'
);
this
.
actualLinePath
=
this
.
chartGroup
.
append
(
'
path
'
).
attr
(
'
class
'
,
'
actual line
'
);
// parse start and due dates
this
.
startDate
=
parseDate
(
startDate
);
...
...
@@ -52,6 +54,11 @@ export default class BurndownChart {
.
tickPadding
(
6
)
.
tickSize
(
4
,
0
);
// create lines
this
.
line
=
d3
.
svg
.
line
()
.
x
(
d
=>
this
.
xScale
(
d
.
date
))
.
y
(
d
=>
this
.
yScale
(
d
.
value
));
// render the chart
this
.
render
();
}
...
...
@@ -70,6 +77,13 @@ export default class BurndownChart {
this
.
xScale
.
domain
([
this
.
startDate
,
this
.
xMax
]);
this
.
yScale
.
domain
([
0
,
this
.
yMax
]);
// set our ideal line data
if
(
this
.
data
.
length
>
1
)
{
const
idealStart
=
this
.
data
[
0
]
||
{
date
:
this
.
startDate
,
value
:
0
};
const
idealEnd
=
{
date
:
this
.
xMax
,
value
:
0
};
this
.
idealData
=
[
idealStart
,
idealEnd
];
}
this
.
render
();
}
...
...
@@ -100,5 +114,10 @@ export default class BurndownChart {
this
.
xAxisGroup
.
call
(
this
.
xAxis
);
this
.
yAxisGroup
.
call
(
this
.
yAxis
);
if
(
this
.
data
!=
null
&&
this
.
data
.
length
>
1
)
{
this
.
actualLinePath
.
datum
(
this
.
data
).
attr
(
'
d
'
,
this
.
line
);
this
.
idealLinePath
.
datum
(
this
.
idealData
).
attr
(
'
d
'
,
this
.
line
);
}
}
}
app/assets/stylesheets/pages/milestone.scss
View file @
e2c39ec9
...
...
@@ -247,6 +247,7 @@
}
$burndown-chart-axis-color
:
#aaa
;
$burndown-chart-line-color
:
#2faa60
;
.burndown-chart
{
width
:
100%
;
...
...
@@ -269,4 +270,18 @@ $burndown-chart-axis-color: #aaa;
shape-rendering
:
crispEdges
;
}
}
.line
{
stroke-width
:
2px
;
fill
:
none
;
&
.actual
{
stroke
:
$burndown-chart-line-color
;
}
&
.ideal
{
stroke
:
$burndown-chart-axis-color
;
stroke-dasharray
:
6px
6px
;
}
}
}
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