1
0

Improve wallet history tab:

- use json-serializable types
- add toolbar to history tab
- add button to display time interval
This commit is contained in:
ThomasV
2018-02-15 14:59:05 +01:00
parent c9ffe8d48a
commit 826cf467d8
6 changed files with 273 additions and 125 deletions

View File

@@ -14,17 +14,16 @@ from matplotlib.patches import Ellipse
from matplotlib.offsetbox import AnchoredOffsetbox, TextArea, DrawingArea, HPacker
def plot_history(wallet, history):
def plot_history(history):
hist_in = defaultdict(int)
hist_out = defaultdict(int)
for item in history:
tx_hash, height, confirmations, timestamp, value, balance = item
if not confirmations:
if not item['confirmations']:
continue
if timestamp is None:
if item['timestamp'] is None:
continue
value = value*1./COIN
date = datetime.datetime.fromtimestamp(timestamp)
value = item['value'].value/COIN
date = item['date']
datenum = int(md.date2num(datetime.date(date.year, date.month, 1)))
if value > 0:
hist_in[datenum] += value