Skip to content

Commit

Permalink
Fix sankey and income/expense categories charts for empty accounts
Browse files Browse the repository at this point in the history
Resolves: #49
  • Loading branch information
andreasgerstmayr committed Jun 8, 2024
1 parent 718653c commit 35caf3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ dashboards:
const divisor = days / (365 / 12);
const accountTree = utils.buildAccountTree(
panel.queries[0].result,
(row) => -row.value[ledger.ccy] / divisor,
(row) => -(row.value[ledger.ccy] ?? 0) / divisor,
(parts, i) => parts[i],
);
// use click event on desktop, dblclick on mobile
Expand Down Expand Up @@ -622,7 +622,7 @@ dashboards:
const divisor = days / (365 / 12);
const accountTree = utils.buildAccountTree(
panel.queries[0].result,
(row) => row.value[ledger.ccy] / divisor,
(row) => (row.value[ledger.ccy] ?? 0) / divisor,
(parts, i) => parts[i],
);
// use click event on desktop, dblclick on mobile
Expand Down Expand Up @@ -1005,7 +1005,7 @@ dashboards:
}
}
const accountTree = utils.buildAccountTree(panel.queries[0].result, (row) => row.value[ledger.ccy]);
const accountTree = utils.buildAccountTree(panel.queries[0].result, (row) => row.value[ledger.ccy] ?? 0);
addNode(accountTree.children[0]);
addNode(accountTree.children[1]);
Expand Down

0 comments on commit 35caf3d

Please sign in to comment.