Merge pull request #3488 from scrool/plot_empty_outgoing_transactions
Handle empty outgoing transactions for plot
This commit is contained in:
@@ -46,7 +46,9 @@ def plot_history(wallet, history):
|
|||||||
dates, values = zip(*sorted(hist_in.items()))
|
dates, values = zip(*sorted(hist_in.items()))
|
||||||
r1 = axarr[0].bar(dates, values, width, label='incoming')
|
r1 = axarr[0].bar(dates, values, width, label='incoming')
|
||||||
axarr[0].legend(loc='upper left')
|
axarr[0].legend(loc='upper left')
|
||||||
dates, values = zip(*sorted(hist_out.items()))
|
dates_values = list(zip(*sorted(hist_out.items())))
|
||||||
r2 = axarr[1].bar(dates, values, width, color='r', label='outgoing')
|
if dates_values and len(dates_values) == 2:
|
||||||
axarr[1].legend(loc='upper left')
|
dates, values = dates_values
|
||||||
|
r2 = axarr[1].bar(dates, values, width, color='r', label='outgoing')
|
||||||
|
axarr[1].legend(loc='upper left')
|
||||||
return plt
|
return plt
|
||||||
|
|||||||
Reference in New Issue
Block a user