diff --git a/finance/grafana/dashboards/finanzen.json b/finance/grafana/dashboards/finanzen.json index 6b2aa3a..2f0ea2a 100644 --- a/finance/grafana/dashboards/finanzen.json +++ b/finance/grafana/dashboards/finanzen.json @@ -103,12 +103,14 @@ "defaults": { "unit": "currencyEUR" }, - "overrides": [] + "overrides": [{ "matcher": { "id": "byType", "options": "time" }, "properties": [{ "id": "unit", "value": "time:MM.YYYY" }] }] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "stacking": "normal", - "xTickLabelRotation": 0 + "xTickLabelRotation": 0, + "showValue": "never", + "tooltip": { "mode": "multi", "sort": "asc" } }, "targets": [ { @@ -175,11 +177,13 @@ "title": "Planung nach Kategorie", "datasource": { "type": "postgres", "uid": "FinanzDB" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 }, - "fieldConfig": { "defaults": { "unit": "currencyEUR" }, "overrides": [] }, + "fieldConfig": { "defaults": { "unit": "currencyEUR" }, "overrides": [{ "matcher": { "id": "byType", "options": "time" }, "properties": [{ "id": "unit", "value": "time:MM.YYYY" }] }] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "stacking": "normal", - "xTickLabelRotation": 0 + "xTickLabelRotation": 0, + "showValue": "never", + "tooltip": { "mode": "multi", "sort": "asc" } }, "targets": [ { diff --git a/finance/tests/test_grafana_dashboard.py b/finance/tests/test_grafana_dashboard.py index 2890427..c6df242 100644 --- a/finance/tests/test_grafana_dashboard.py +++ b/finance/tests/test_grafana_dashboard.py @@ -69,3 +69,22 @@ def test_panels_ueberlappen_nicht_und_ids_eindeutig(): for y in range(g["y"], g["y"] + g["h"]): assert (x, y) not in cells, p["title"] cells.add((x, y)) + + +BARCHARTS = ("Monat nach Kategorie", "Planung nach Kategorie") + + +def test_barcharts_ohne_segment_beschriftung_mit_voller_aufschluesselung(): + """Gestapelte Balken mit vielen Kategorien: Segment-Beschriftungen + überlagern sich (sichtbar bleibt ein zufälliger kleiner Wert). Daher keine + Werte im Balken, stattdessen alle Kategorien im Tooltip, größte Ausgabe + zuerst, und den Monat ohne Uhrzeit (Monatserster UTC wirkte in MEZ wie + 01:00 Uhr).""" + panels = {p["title"]: p for p in _load()["panels"]} + for title in BARCHARTS: + p = panels[title] + assert p["options"]["showValue"] == "never", title + assert p["options"]["tooltip"] == {"mode": "multi", "sort": "asc"}, title + overrides = p["fieldConfig"]["overrides"] + assert {"matcher": {"id": "byType", "options": "time"}, + "properties": [{"id": "unit", "value": "time:MM.YYYY"}]} in overrides, title