Commit 9e32cca3 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Improve the layout of the dashboard.

parent afedf45b
...@@ -28,6 +28,8 @@ def dashboard(): ...@@ -28,6 +28,8 @@ def dashboard():
the current year. the current year.
""" """
current_year = datetime.now().year
cfg = Storage() cfg = Storage()
cfg.Graph_selectorCumulative = 'True' cfg.Graph_selectorCumulative = 'True'
cfg.Graph_selectorId = '' cfg.Graph_selectorId = ''
...@@ -46,12 +48,13 @@ def dashboard(): ...@@ -46,12 +48,13 @@ def dashboard():
# figure layout # figure layout
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, sharey=True) fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, sharey=True)
fig.subplots_adjust(wspace=0.) fig.subplots_adjust(wspace=0.01)
# histogram of the number of publications per year # histogram of the number of publications per year
selector.cumulative = False selector.cumulative = False
selector.time = T('year') selector.time = T('year')
selector.year_start = '' selector.year_start = ''
selector.year_end = current_year - 1
do_linechart(db.publications, selector, target=ax1) do_linechart(db.publications, selector, target=ax1)
do_labels(ax1, "", T(TITLE_Y)) do_labels(ax1, "", T(TITLE_Y))
...@@ -59,7 +62,8 @@ def dashboard(): ...@@ -59,7 +62,8 @@ def dashboard():
# the cumulative sum of publications for the current year # the cumulative sum of publications for the current year
selector.cumulative = True selector.cumulative = True
selector.time = T('month') selector.time = T('month')
selector.year_start = datetime.now().year selector.year_start = current_year
selector.year_end = ''
do_linechart(db.publications, selector, target=ax2) do_linechart(db.publications, selector, target=ax2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment