From a46b8f895a014857769f174277aa43210d4b40a4 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 18 Jan 2026 22:21:14 +1100 Subject: [PATCH] sort annotations so the historical annotations are drawn first, so up/down labels are mostly working properly --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index b5f83a9..3451930 100644 --- a/main.py +++ b/main.py @@ -33,6 +33,8 @@ def index(): bill_types = get_bill_types() depletion_date, savings_per_fortnight, final_savings = calculate_savings_depletion(finance_data, bill_data, bill_types) add_historical_annotations( finance_data ) + # now sort this by X, then Y, to get the historical ones in the right order + finance_data['annotations'].sort(key=lambda item: (item['x'], item['y'])) BUDGET=get_budget_data(finance_data) if depletion_date: