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
2b9a64a2
Commit
2b9a64a2
authored
Aug 08, 2017
by
Jason Dai
Committed by
Clement Ho
Aug 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bar chart does not display label at hour 0
parent
2b781c78
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
app/assets/javascripts/graphs/graphs_charts.js
app/assets/javascripts/graphs/graphs_charts.js
+16
-18
app/views/projects/graphs/charts.html.haml
app/views/projects/graphs/charts.html.haml
+3
-3
changelogs/unreleased/35136-barchart-not-display-label-at-0-hour.yml
...unreleased/35136-barchart-not-display-label-at-0-hour.yml
+4
-0
No files found.
app/assets/javascripts/graphs/graphs_charts.js
View file @
2b9a64a2
import
Chart
from
'
vendor/Chart
'
;
import
Chart
from
'
vendor/Chart
'
;
import
_
from
'
underscore
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
projectChartData
=
JSON
.
parse
(
document
.
getElementById
(
'
projectChartData
'
).
innerHTML
);
const
projectChartData
=
JSON
.
parse
(
document
.
getElementById
(
'
projectChartData
'
).
innerHTML
);
...
@@ -27,28 +28,25 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -27,28 +28,25 @@ document.addEventListener('DOMContentLoaded', () => {
return
generateChart
();
return
generateChart
();
};
};
const
chartData
=
(
keys
,
values
)
=>
{
const
chartData
=
data
=>
({
const
data
=
{
labels
:
Object
.
keys
(
data
),
labels
:
keys
,
datasets
:
[{
datasets
:
[{
fillColor
:
'
rgba(220,220,220,0.5)
'
,
fillColor
:
'
rgba(220,220,220,0.5)
'
,
strokeColor
:
'
rgba(220,220,220,1)
'
,
strokeColor
:
'
rgba(220,220,220,1)
'
,
barStrokeWidth
:
1
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
_
.
values
(
data
),
data
:
values
,
}],
}],
});
};
return
data
;
const
hourData
=
chartData
(
projectChartData
.
hour
);
};
const
hourData
=
chartData
(
projectChartData
.
hour
.
keys
,
projectChartData
.
hour
.
values
);
responsiveChart
(
$
(
'
#hour-chart
'
),
hourData
);
responsiveChart
(
$
(
'
#hour-chart
'
),
hourData
);
const
dayData
=
chartData
(
projectChartData
.
weekDays
.
keys
,
projectChartData
.
weekDays
.
values
);
const
dayData
=
chartData
(
projectChartData
.
weekDays
);
responsiveChart
(
$
(
'
#weekday-chart
'
),
dayData
);
responsiveChart
(
$
(
'
#weekday-chart
'
),
dayData
);
const
monthData
=
chartData
(
projectChartData
.
month
.
keys
,
projectChartData
.
month
.
values
);
const
monthData
=
chartData
(
projectChartData
.
month
);
responsiveChart
(
$
(
'
#month-chart
'
),
monthData
);
responsiveChart
(
$
(
'
#month-chart
'
),
monthData
);
const
data
=
projectChartData
.
languages
;
const
data
=
projectChartData
.
languages
;
...
...
app/views/projects/graphs/charts.html.haml
View file @
2b9a64a2
...
@@ -78,8 +78,8 @@
...
@@ -78,8 +78,8 @@
%script
#projectChartData
{
type:
"application/json"
}
%script
#projectChartData
{
type:
"application/json"
}
-
projectChartData
=
{};
-
projectChartData
=
{};
-
projectChartData
[
'hour'
]
=
{
'keys'
=>
@commits_per_time
.
keys
,
'values'
=>
@commits_per_time
.
values
}
-
projectChartData
[
'hour'
]
=
@commits_per_time
-
projectChartData
[
'weekDays'
]
=
{
'keys'
=>
@commits_per_week_days
.
keys
,
'values'
=>
@commits_per_week_days
.
values
}
-
projectChartData
[
'weekDays'
]
=
@commits_per_week_days
-
projectChartData
[
'month'
]
=
{
'keys'
=>
@commits_per_month
.
keys
,
'values'
=>
@commits_per_month
.
values
}
-
projectChartData
[
'month'
]
=
@commits_per_month
-
projectChartData
[
'languages'
]
=
@languages
-
projectChartData
[
'languages'
]
=
@languages
=
projectChartData
.
to_json
.
html_safe
=
projectChartData
.
to_json
.
html_safe
changelogs/unreleased/35136-barchart-not-display-label-at-0-hour.yml
0 → 100644
View file @
2b9a64a2
---
title
:
Fix bar chart does not display label at 0 hour
merge_request
:
35136
author
:
Jason Dai
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