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
63fa244e
Commit
63fa244e
authored
Mar 29, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create x-axis line in constructor instead of regenerating on each render
parent
c44a9d22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
app/assets/javascripts/burndown_chart/burndown_chart.js
app/assets/javascripts/burndown_chart/burndown_chart.js
+5
-2
No files found.
app/assets/javascripts/burndown_chart/burndown_chart.js
View file @
63fa244e
import
d3
from
'
d3
'
;
const
margin
=
{
top
:
5
,
right
:
65
,
bottom
:
30
,
left
:
4
0
};
const
margin
=
{
top
:
5
,
right
:
65
,
bottom
:
30
,
left
:
5
0
};
const
parseDate
=
d3
.
time
.
format
(
'
%Y-%m-%d
'
).
parse
;
export
default
class
BurndownChart
{
...
...
@@ -16,6 +16,8 @@ export default class BurndownChart {
this
.
idealLinePath
=
this
.
chartGroup
.
append
(
'
path
'
).
attr
(
'
class
'
,
'
ideal line
'
);
this
.
actualLinePath
=
this
.
chartGroup
.
append
(
'
path
'
).
attr
(
'
class
'
,
'
actual line
'
);
this
.
xAxisGroup
.
append
(
'
line
'
).
attr
(
'
class
'
,
'
domain-line
'
);
// parse start and due dates
this
.
startDate
=
parseDate
(
startDate
);
this
.
dueDate
=
parseDate
(
dueDate
);
...
...
@@ -117,8 +119,9 @@ export default class BurndownChart {
this
.
xAxisGroup
.
call
(
this
.
xAxis
);
this
.
yAxisGroup
.
call
(
this
.
yAxis
);
// replace x-axis line with one which continues into the right margin
this
.
xAxisGroup
.
select
(
'
.domain
'
).
remove
();
this
.
xAxisGroup
.
append
(
'
line
'
).
attr
(
'
x1
'
,
0
).
attr
(
'
x2
'
,
this
.
chartWidth
+
margin
.
right
);
this
.
xAxisGroup
.
select
(
'
.domain-
line
'
).
attr
(
'
x1
'
,
0
).
attr
(
'
x2
'
,
this
.
chartWidth
+
margin
.
right
);
if
(
this
.
data
!=
null
&&
this
.
data
.
length
>
1
)
{
this
.
actualLinePath
.
datum
(
this
.
data
).
attr
(
'
d
'
,
this
.
line
);
...
...
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