Skip to content

Commit

Permalink
Sort values before plotting in analytics_page
Browse files Browse the repository at this point in the history
Addresses #3.
  • Loading branch information
alchenist committed Aug 16, 2016
1 parent e09644c commit e5202d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cityscore/cityscore/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def analytics_page(request, name = "Library Users"):
ax.spines["left"].set_visible(False)
y = [s for s in score_list]
x = [v.entry_date for v in values]
x, y = zip(*sorted(zip(x, y), key = lambda d: d[0]))
ax.plot_date(x, y, '-')
ax.xaxis.set_major_formatter(DateFormatter('%Y-%m-%d'))
fig.autofmt_xdate()
Expand Down

0 comments on commit e5202d8

Please sign in to comment.