statistics: add a zero entry in empty stat results, for jqplot (#7061)
This commit is contained in:
parent
6bad90e7f7
commit
9ceaebdac8
|
@ -112,6 +112,11 @@ def do_graphs_section(period_start=None, period_end=None, criterias=None):
|
|||
monthly_totals = sql.get_monthly_totals(period_start, period_end, criterias)[-12:]
|
||||
yearly_totals = sql.get_yearly_totals(period_start, period_end, criterias)[-10:]
|
||||
|
||||
if not monthly_totals:
|
||||
monthly_totals = [('%s-%s' % datetime.date.today().timetuple()[:2], 0)]
|
||||
if not yearly_totals:
|
||||
yearly_totals = [(datetime.date.today().year, 0)]
|
||||
|
||||
weekday_totals = sql.get_weekday_totals(period_start, period_end, criterias)
|
||||
weekday_line = []
|
||||
weekday_names = [_('Sunday'), _('Monday'), _('Tuesday'),
|
||||
|
|
Loading…
Reference in New Issue