Improve wallet history tab:
- use json-serializable types - add toolbar to history tab - add button to display time interval
This commit is contained in:
11
lib/plot.py
11
lib/plot.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user