activity: add option to control bar width

This commit is contained in:
Frédéric Péters 2017-10-15 22:09:05 +02:00
parent afb98a9536
commit 7df313e688
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ class Command(GraphCommand):
parser.add_argument('--modulecount', type=int,
help='count number of modules instead of commits '
'(value is minimum number of commits to be counted in)')
parser.add_argument('--barwidth', type=int, default=20)
def handle(self, *args, **options):
title = 'Git activity'
@ -55,7 +56,7 @@ class Command(GraphCommand):
values = [events[x] for x in dates]
bottoms = [total_events.get(x, 0) for x in dates]
plot = plt.bar(dates, values, width=20, bottom=bottoms)
plot = plt.bar(dates, values, width=options.get('barwidth'), bottom=bottoms)
plots.append((legend, plot))
for key, value in events.items():