Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
5341f1ae
Commit
5341f1ae
authored
Jan 19, 2016
by
LE GAC Renaud
Browse files
Re-organize the graph dashboard.
parent
930a30dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
controllers/graphs.py
controllers/graphs.py
+13
-10
No files found.
controllers/graphs.py
View file @
5341f1ae
...
...
@@ -35,8 +35,8 @@ def dashboard():
cfg
.
Graph_selectorId_graphs
=
''
cfg
.
Graph_selectorId_projects
=
''
cfg
.
Graphs_selectorId_teams
=
''
cfg
.
Graph_selectorTime
=
T
(
'month'
)
cfg
.
Graph_selectorYear_start
=
datetime
.
now
().
year
cfg
.
Graph_selectorTime
=
''
cfg
.
Graph_selectorYear_start
=
''
cfg
.
Graph_selectorYear_end
=
''
request
.
vars
.
update
(
cfg
)
...
...
@@ -45,20 +45,23 @@ def dashboard():
selector
=
Selector
(
virtdb
.
graph_selector
,
exclude_fields
=
fields
)
# figure layout
fig
,
axes
=
plt
.
subplots
(
nrows
=
1
,
ncols
=
2
,
sharey
=
True
)
fig
.
subplots_adjust
(
wspace
=
0.1
)
# the cumulative sum of publications for the current year
do_linechart
(
db
.
publications
,
selector
,
target
=
axes
[
0
])
do_labels
(
axes
[
0
],
""
,
T
(
TITLE_Y
))
fig
,
(
ax1
,
ax2
)
=
plt
.
subplots
(
nrows
=
1
,
ncols
=
2
,
sharey
=
True
)
fig
.
subplots_adjust
(
wspace
=
0.
)
# histogram of the number of publications per year
selector
.
cumulative
=
False
selector
.
time
=
T
(
'year'
)
selector
.
year_start
=
''
do_linechart
(
db
.
publications
,
selector
,
target
=
axes
[
1
])
do_labels
(
axes
[
1
],
""
,
""
)
do_linechart
(
db
.
publications
,
selector
,
target
=
ax1
)
do_labels
(
ax1
,
""
,
T
(
TITLE_Y
))
# the cumulative sum of publications for the current year
selector
.
cumulative
=
True
selector
.
time
=
T
(
'month'
)
selector
.
year_start
=
datetime
.
now
().
year
do_linechart
(
db
.
publications
,
selector
,
target
=
ax2
)
# delegate the rendering to the view
response
.
view
=
"graphs/index.html"
...
...
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