commit 9966dc3b0c6cb7d0c50668ee513a110d5bab1c2b
parent 1ddbd633b8a708a971b052e6cc1011f975411180
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 12 Dec 2017 17:58:49 +0100
Merge pull request #3488 from scrool/plot_empty_outgoing_transactions
Handle empty outgoing transactions for plot
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/plot.py b/lib/plot.py
@@ -46,7 +46,9 @@ def plot_history(wallet, history):
dates, values = zip(*sorted(hist_in.items()))
r1 = axarr[0].bar(dates, values, width, label='incoming')
axarr[0].legend(loc='upper left')
- dates, values = zip(*sorted(hist_out.items()))
- r2 = axarr[1].bar(dates, values, width, color='r', label='outgoing')
- axarr[1].legend(loc='upper left')
+ dates_values = list(zip(*sorted(hist_out.items())))
+ if dates_values and len(dates_values) == 2:
+ dates, values = dates_values
+ r2 = axarr[1].bar(dates, values, width, color='r', label='outgoing')
+ axarr[1].legend(loc='upper left')
return plt