From 252dc2336488582838585bf3be07cb1e2bd14b9d Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Tue, 16 Sep 2025 23:24:19 +1000 Subject: [PATCH] make payment annotations show as negatives, use this to make annotations of adding go above graph, and generally payment annotaions below the line. Then switch to have the last few annoations above the graph regardless as we run out of room at that end of the graph --- calc.py | 2 +- templates/index.html | 52 +++++++++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/calc.py b/calc.py index 8e1f04b..8cdcd09 100644 --- a/calc.py +++ b/calc.py @@ -25,7 +25,7 @@ def bill_amount_today(finance, day, bill_data, bt_id_name, total ): if b['amount'] > 1000: n=bt_id_name[ b['bill_type'] ] print( f"bill_amt_today {n} for {day_str} has amt={amt}" ) - add_annotation(finance, day, total-amt, amt, f"Pay {n}" ) + add_annotation(finance, day, total-amt, -amt, f"Pay {n}" ) # bills are desc order so if the bill is before the day we are after then stop looking if b['bill_date'] < day_str: return amt diff --git a/templates/index.html b/templates/index.html index 88828f7..6c5cae6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -187,10 +187,10 @@
-
+
-
+