From 5bfb90a5479e0cfc8c1a57ef85f8c8d191a47ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Murta?= Date: Wed, 7 Jul 2021 20:14:03 +0100 Subject: [PATCH] Remove investments from graph Investments are not normally reported on the receiving end in transaction logs, and they introduce too much visual noise in monthly expense graphs. As such they will later appear in relevant invesment graphs, but are removed for now from the available choices. --- categories.yaml | 3 +++ pfbudget/graph.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/categories.yaml b/categories.yaml index f69bf74..dec6dd3 100644 --- a/categories.yaml +++ b/categories.yaml @@ -49,6 +49,9 @@ Entertainment: - cinema - steam +Investment: + group: investment + Pets: group: required diff --git a/pfbudget/graph.py b/pfbudget/graph.py index 4836c9a..b134478 100644 --- a/pfbudget/graph.py +++ b/pfbudget/graph.py @@ -49,9 +49,13 @@ def monthly(db: DBManager, start: dt.date = dt.date.min, end: dt.date = dt.date. [ [-groups[group] for _, groups in monthly_transactions] for group in pfbudget.categories.groups - if group != "income" + if group != "income" and group != "investment" + ], + labels=[ + group + for group in pfbudget.categories.groups + if group != "income" and group != "investment" ], - labels=[group for group in pfbudget.categories.groups if group != "income"], ) plt.legend(loc="upper left") plt.tight_layout() @@ -103,11 +107,13 @@ def discrete(db: DBManager, start: dt.date = dt.date.min, end: dt.date = dt.date [-categories[category] for _, categories in monthly_transactions] for category in pfbudget.categories.categories if category not in pfbudget.categories.groups["income"] + and category not in pfbudget.categories.groups["investment"] ], labels=[ category for category in pfbudget.categories.categories if category not in pfbudget.categories.groups["income"] + and category not in pfbudget.categories.groups["investment"] ], ) plt.legend(loc="upper left")